c# .net framework 4.8 webapp binding redirect works on laptop, but not when deployed on IIS via build server (I have a netstandard dependency)

1

My framework 4.8 webapp sln (using package.config nuget), has a dependency on a netstandard2.0 lib. When I deploy the webapp, via build server, to IIS I get a binding redirect problem where the redirect in my web.config directs e.g.

===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\xxx\yyy\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.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/root/af8f859d/2f94c10f/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/af8f859d/2f94c10f/System.Buffers/System.Buffers.DLL.
LOG: Attempting download of new URL file:///D:/xxx/yyy/bin/System.Buffers.DLL.
LOG: Using application configuration file: D:\xxx\yyy\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.2.0 redirected to 4.0.3.0.
LOG: Post-policy reference: System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/af8f859d/2f94c10f/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/af8f859d/2f94c10f/System.Buffers/System.Buffers.DLL.
LOG: Attempting download of new URL file:///D:/xxx/yyy/bin/System.Buffers.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

That redirect was generated by VS2019 (and works on my laptop) but it breaks on the IIS, because 4.0.3.0 isn't there, even though I've got "copy local" set. I think my problem is something to do with netstandard (cc7b13ffcd2ddd51) having a different 4.0.2.0 version of that assembly that framework (b07...). If I tweak the redirect on the IIS, it works again, but that means my autogenerated binding redirects are no longer valid.

Any clues please? thanks

c#
.net
asp.net-mvc
.net-standard
asked on Stack Overflow Jan 29, 2020 by timB33

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0