c#.net framework 4.8 webapp绑定重定向在笔记本电脑上工作,但在通过构建服务器部署到IIS上时不工作(我有一个netstandard依赖项)

c#.net framework 4.8 webapp绑定重定向在笔记本电脑上工作,但在通过构建服务器部署到IIS上时不工作(我有一个netstandard依赖项),c#,.net,asp.net-mvc,.net-standard,C#,.net,Asp.net Mvc,.net Standard,我的framework 4.8 webapp sln(使用package.config nuget)依赖于netstandard2.0库。当我通过build server将webapp部署到IIS时,我会遇到绑定重定向问题,其中web.config中的重定向会指向该问题,例如 === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\xxx\yyy\web.co

我的framework 4.8 webapp sln(使用package.config nuget)依赖于netstandard2.0库。当我通过build server将webapp部署到IIS时,我会遇到绑定重定向问题,其中web.config中的重定向会指向该问题,例如

===
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.
该重定向由VS2019生成(可在我的笔记本电脑上运行),但在IIS上会中断,因为4.0.3.0不存在,即使我设置了“复制本地”。 我认为我的问题与netstandard(CC7B13FFCD2DD51)有一个不同的4.0.2.0版本的程序集框架(b07…)有关。如果我在IIS上调整重定向,它会再次工作,但这意味着我自动生成的绑定重定向不再有效


有什么线索吗?谢谢

您是否在笔记本电脑上使用独立于Visual Studio的本地IIS实例进行测试?或者,您是通过直接从Visual Studio运行它来测试它吗?我没有在我的笔记本电脑上部署它,我只是按了F5。这就是为什么它可以在您的笔记本电脑上工作。Visual Studio没有使用与IIS或生成服务器相同的设置。您可能使用与服务器不同的msbuild版本,也可能只是IIS配置。所以,部署后我必须手动调整这些绑定?本地副本应该意味着我可以在bin文件夹中获得正确的程序集版本?您是否在笔记本电脑上使用独立于Visual Studio的IIS本地实例进行测试?或者,您是通过直接从Visual Studio运行它来测试它吗?我没有在我的笔记本电脑上部署它,我只是按了F5。这就是为什么它可以在您的笔记本电脑上工作。Visual Studio没有使用与IIS或生成服务器相同的设置。您可能使用与服务器不同的msbuild版本,也可能只是IIS配置。所以,部署后我必须手动调整这些绑定?本地副本应该意味着我可以在bin文件夹中获得正确的程序集版本?