Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows MSI安装程序:依赖项解析不起作用,安装了错误的程序集_C#_.net_Windows Installer_Assembly Binding Redirect - Fatal编程技术网

C# Windows MSI安装程序:依赖项解析不起作用,安装了错误的程序集

C# Windows MSI安装程序:依赖项解析不起作用,安装了错误的程序集,c#,.net,windows-installer,assembly-binding-redirect,C#,.net,Windows Installer,Assembly Binding Redirect,我对Visual Studio 2019中的msi安装程序有问题。 不知何故,某些程序集将以错误的版本安装 调试文件夹 文件名:System.Diagnostics.Tracing.dll 文件版本:4.6.26011.01 组装版本:4.2.0.0 安装文件夹 文件名:System.Diagnostics.Tracing.dll 文件版本:4.8.3761.0生成者:NET48REL1 组装版本:4.0.0.0 nuget不会直接引用所有错误的程序集 System.Diagnosti

我对Visual Studio 2019中的msi安装程序有问题。 不知何故,某些程序集将以错误的版本安装

  • 调试文件夹

    • 文件名:System.Diagnostics.Tracing.dll
    • 文件版本:4.6.26011.01
    • 组装版本:4.2.0.0
  • 安装文件夹

    • 文件名:System.Diagnostics.Tracing.dll
    • 文件版本:4.8.3761.0生成者:NET48REL1
    • 组装版本:4.0.0.0
  • nuget不会直接引用所有错误的程序集

    • System.Diagnostics.Tracing.dll
    • System.IO.Compression.dll
    • System.Net.Http.dll
    • System.Runtime.Serialization.Primitives.dll
    • System.Security.Cryptography.Algorithms.dll
    • System.Security.SecureString.dll
    当我从debug或release文件夹本地启动我的应用程序时,一切都正常工作

    我的绑定重定向如下所示:

     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
          </dependentAssembly>
        </assemblyBinding>
    ...
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
          </dependentAssembly>
    
    
    直接从Microsoft.Extensions.Configuration.Json.JSONConfiguration文件解析器

    不知怎的,这对我来说很奇怪,我不明白发生了什么,为什么绑定失败了
    也许有人可以帮我解决这个问题,或者向我解释一下你使用Visual Studio安装程序项目或WiX或其他什么东西的行为

    我使用,甚至尝试过同样的问题
     "System.Runtime.CompilerServices.Unsafe, 
     Version=4.0.4.1, Culture=neutral, 
     PublicKeyToken=b03f5f7f11d50a3a"