Automapper and System.ValueTuple dependency/versioning problem
I have just added Automapper to my asp.net application (.net Framework 4.7), to see hopefully being able to replace some of the tedious manual mapping I always need to do.
I am now having a lot of problems with System.ValueTuple versions. I Notice I have a nuget package for System.ValueTuple v4.5.0
. If I look into my solutions packagesSystem.ValueTuple.4.5.0libnet47System.ValueTuple.dll
I see this as version 4.6.26515.06. If I look into one of the projects I have this nuget package (the one that I added Automapper to), However, when I look in my bin
folder after a build I have version 4.6.25514.4
, ie and older version to what the nuget package has
When I build the app on the build machine picks up 4.6011.3
. Yet another version!!!
I cannot uninstall the nuget package as it says that Automapper has a dependency on it.
When a user ran the application, they go the yellow screen of death, with
Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Does anyone know how to sort out this System.ValueTuple, and know why I seem to be getting random versions of it all over the place?
Thanks in advance!
[EDIT1]
Following @Lucian suggestion, I ran the Fusion tool on both my dev machine, and the other machine where it does not work.
I noticed, on my machine the ValueTuple DLL being found in my bin claimed to be version 4.0.2.0
, and not what the file version was.
So I added...
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="4.0.3.0" newVersion="4.0.2.0" />
</dependentAssembly>
Previously, on my dev machine if I added any of these bindingRedirect
I would also get the error, but now, with the above it worked.
However, it did not on the other production (internal test) machine. From that machine I have the following output (once I finally got Fusion to work) ...
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I can see the line Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
which it gets from the web.config
, and 4.0.2.0
is what should be in the bin folder. This is also the version that shows up in Dotpeek..
For some reason, it then seems to try and get this DLL from C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp
, and it seems to end up with Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
and then it fails reports..
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
If I remove this bindingRedirect
, it then reports looking for version 0.0.0.0
. I have no idea what is going on here. The version we are trying to remap to, i.e. 4.0.2.0
, is in the bin folder!
I also deleted the folder C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp
, but this made no difference.
Any other ideas would be greatly appreciated.
asp.net .net automapper
|
show 5 more comments
I have just added Automapper to my asp.net application (.net Framework 4.7), to see hopefully being able to replace some of the tedious manual mapping I always need to do.
I am now having a lot of problems with System.ValueTuple versions. I Notice I have a nuget package for System.ValueTuple v4.5.0
. If I look into my solutions packagesSystem.ValueTuple.4.5.0libnet47System.ValueTuple.dll
I see this as version 4.6.26515.06. If I look into one of the projects I have this nuget package (the one that I added Automapper to), However, when I look in my bin
folder after a build I have version 4.6.25514.4
, ie and older version to what the nuget package has
When I build the app on the build machine picks up 4.6011.3
. Yet another version!!!
I cannot uninstall the nuget package as it says that Automapper has a dependency on it.
When a user ran the application, they go the yellow screen of death, with
Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Does anyone know how to sort out this System.ValueTuple, and know why I seem to be getting random versions of it all over the place?
Thanks in advance!
[EDIT1]
Following @Lucian suggestion, I ran the Fusion tool on both my dev machine, and the other machine where it does not work.
I noticed, on my machine the ValueTuple DLL being found in my bin claimed to be version 4.0.2.0
, and not what the file version was.
So I added...
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="4.0.3.0" newVersion="4.0.2.0" />
</dependentAssembly>
Previously, on my dev machine if I added any of these bindingRedirect
I would also get the error, but now, with the above it worked.
However, it did not on the other production (internal test) machine. From that machine I have the following output (once I finally got Fusion to work) ...
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I can see the line Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
which it gets from the web.config
, and 4.0.2.0
is what should be in the bin folder. This is also the version that shows up in Dotpeek..
For some reason, it then seems to try and get this DLL from C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp
, and it seems to end up with Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
and then it fails reports..
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
If I remove this bindingRedirect
, it then reports looking for version 0.0.0.0
. I have no idea what is going on here. The version we are trying to remap to, i.e. 4.0.2.0
, is in the bin folder!
I also deleted the folder C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp
, but this made no difference.
Any other ideas would be greatly appreciated.
asp.net .net automapper
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add<bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an errorCould not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.
– peterc
Nov 19 '18 at 8:35
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38
|
show 5 more comments
I have just added Automapper to my asp.net application (.net Framework 4.7), to see hopefully being able to replace some of the tedious manual mapping I always need to do.
I am now having a lot of problems with System.ValueTuple versions. I Notice I have a nuget package for System.ValueTuple v4.5.0
. If I look into my solutions packagesSystem.ValueTuple.4.5.0libnet47System.ValueTuple.dll
I see this as version 4.6.26515.06. If I look into one of the projects I have this nuget package (the one that I added Automapper to), However, when I look in my bin
folder after a build I have version 4.6.25514.4
, ie and older version to what the nuget package has
When I build the app on the build machine picks up 4.6011.3
. Yet another version!!!
I cannot uninstall the nuget package as it says that Automapper has a dependency on it.
When a user ran the application, they go the yellow screen of death, with
Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Does anyone know how to sort out this System.ValueTuple, and know why I seem to be getting random versions of it all over the place?
Thanks in advance!
[EDIT1]
Following @Lucian suggestion, I ran the Fusion tool on both my dev machine, and the other machine where it does not work.
I noticed, on my machine the ValueTuple DLL being found in my bin claimed to be version 4.0.2.0
, and not what the file version was.
So I added...
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="4.0.3.0" newVersion="4.0.2.0" />
</dependentAssembly>
Previously, on my dev machine if I added any of these bindingRedirect
I would also get the error, but now, with the above it worked.
However, it did not on the other production (internal test) machine. From that machine I have the following output (once I finally got Fusion to work) ...
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I can see the line Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
which it gets from the web.config
, and 4.0.2.0
is what should be in the bin folder. This is also the version that shows up in Dotpeek..
For some reason, it then seems to try and get this DLL from C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp
, and it seems to end up with Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
and then it fails reports..
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
If I remove this bindingRedirect
, it then reports looking for version 0.0.0.0
. I have no idea what is going on here. The version we are trying to remap to, i.e. 4.0.2.0
, is in the bin folder!
I also deleted the folder C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp
, but this made no difference.
Any other ideas would be greatly appreciated.
asp.net .net automapper
I have just added Automapper to my asp.net application (.net Framework 4.7), to see hopefully being able to replace some of the tedious manual mapping I always need to do.
I am now having a lot of problems with System.ValueTuple versions. I Notice I have a nuget package for System.ValueTuple v4.5.0
. If I look into my solutions packagesSystem.ValueTuple.4.5.0libnet47System.ValueTuple.dll
I see this as version 4.6.26515.06. If I look into one of the projects I have this nuget package (the one that I added Automapper to), However, when I look in my bin
folder after a build I have version 4.6.25514.4
, ie and older version to what the nuget package has
When I build the app on the build machine picks up 4.6011.3
. Yet another version!!!
I cannot uninstall the nuget package as it says that Automapper has a dependency on it.
When a user ran the application, they go the yellow screen of death, with
Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Does anyone know how to sort out this System.ValueTuple, and know why I seem to be getting random versions of it all over the place?
Thanks in advance!
[EDIT1]
Following @Lucian suggestion, I ran the Fusion tool on both my dev machine, and the other machine where it does not work.
I noticed, on my machine the ValueTuple DLL being found in my bin claimed to be version 4.0.2.0
, and not what the file version was.
So I added...
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="4.0.3.0" newVersion="4.0.2.0" />
</dependentAssembly>
Previously, on my dev machine if I added any of these bindingRedirect
I would also get the error, but now, with the above it worked.
However, it did not on the other production (internal test) machine. From that machine I have the following output (once I finally got Fusion to work) ...
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
*** Assembly Binder Log Entry (20/11/2018 @ 9:16:49 AM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable c:windowssystem32inetsrvw3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.ValueTuple
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.ValueTuple | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/MyApp/
LOG: Initial PrivatePath = C:inetpubwwwrootMyAppbin
LOG: Dynamic Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: Cache Base = C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp718df87
LOG: AppName = ab2266c7
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:inetpubwwwrootMyAppweb.config
LOG: Using host configuration file: C:WindowsMicrosoft.NETFramework64v4.0.30319aspnet.config
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
LOG: Post-policy reference: System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp/0718df87/ab2266c7/System.ValueTuple/System.ValueTuple.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/MyApp/bin/System.ValueTuple.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:inetpubwwwrootMyAppbinSystem.ValueTuple.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I can see the line Redirect found in application configuration file: 4.0.3.0 redirected to 4.0.2.0.
which it gets from the web.config
, and 4.0.2.0
is what should be in the bin folder. This is also the version that shows up in Dotpeek..
For some reason, it then seems to try and get this DLL from C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/MyApp
, and it seems to end up with Assembly Name is: System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
and then it fails reports..
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
If I remove this bindingRedirect
, it then reports looking for version 0.0.0.0
. I have no idea what is going on here. The version we are trying to remap to, i.e. 4.0.2.0
, is in the bin folder!
I also deleted the folder C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET FilesMyApp
, but this made no difference.
Any other ideas would be greatly appreciated.
asp.net .net automapper
asp.net .net automapper
edited Nov 20 '18 at 13:48
peterc
asked Nov 19 '18 at 3:26
petercpeterc
1,4172851
1,4172851
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add<bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an errorCould not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.
– peterc
Nov 19 '18 at 8:35
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38
|
show 5 more comments
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add<bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an errorCould not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.
– peterc
Nov 19 '18 at 8:35
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs
4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add <bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an error Could not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.– peterc
Nov 19 '18 at 8:35
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs
4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add <bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an error Could not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.– peterc
Nov 19 '18 at 8:35
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38
|
show 5 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367919%2fautomapper-and-system-valuetuple-dependency-versioning-problem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53367919%2fautomapper-and-system-valuetuple-dependency-versioning-problem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
<dependentAssembly> <assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.3.0"/> </dependentAssembly>
– Lucian Bargaoanu
Nov 19 '18 at 6:25
@ Lucian Unfortunately the above makes it yellow screen even on my dev machine (where it normally) works. I have tried just about every combination of the bindingRedirect, tried copying different assembly version on the other troubled machine. I even uninstalled Automapper, and now I always get problems with System.ValueTuple. I wonder what this is for anyway?
– peterc
Nov 19 '18 at 6:52
OK, maybe I've got the binding redirect wrong. But as long as you get the versions correct, only one version will be used at runtime and the problem is solved. I'm sure a lot of people already solved this.
– Lucian Bargaoanu
Nov 19 '18 at 8:06
I have uninstalled both ValueTuple and Automapper numerous times. When I add Automapper back it always installs
4.5.0
. This is the only version referenced anywhere. If I follow the reference to the nuget folder, I see file version 4.6.25514.4. On my dev machine if I add<bindingRedirect oldVersion="4.0.3.0" newVersion="4.6.25514.4" />
I get an errorCould not load file or assembly
System.ValueTuple, Version=4.0.3.0`. If I remove this, it works on my machine, but not on others (even when I manually copy over the exact DLL into the deployed bin folder. Makes no sense to me at all.– peterc
Nov 19 '18 at 8:35
Fusion log viewer is used to investigate these issues.
– Lucian Bargaoanu
Nov 19 '18 at 12:38