Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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
Windows 如何:msvcrt9的多个版本作为专用SxS程序集?_Windows_Unmanaged_Side By Side - Fatal编程技术网

Windows 如何:msvcrt9的多个版本作为专用SxS程序集?

Windows 如何:msvcrt9的多个版本作为专用SxS程序集?,windows,unmanaged,side-by-side,Windows,Unmanaged,Side By Side,我有一个项目,包括预构建Dll模块,在过去某个时候使用Visual Studio 9构建 该项目的EXE现在使用VisualStudio9的SP1构建 当我们部署EXE时,我们不希望需要管理访问权限,因此C-Runtime已绑定到应用程序的根目录中。DLL:MSVCRT90.DLL及其清单:Microsoft.VC90.CRT.Manifest 现在,EXE和最新版本的运行时清单都是一致的——应用程序清单要求9.0.30729.1版本的msvcrt.dll,crt清单包含确认msvcrt90.d

我有一个项目,包括预构建Dll模块,在过去某个时候使用Visual Studio 9构建

该项目的EXE现在使用VisualStudio9的SP1构建

当我们部署EXE时,我们不希望需要管理访问权限,因此C-Runtime已绑定到应用程序的根目录中。DLL:MSVCRT90.DLL及其清单:Microsoft.VC90.CRT.Manifest

现在,EXE和最新版本的运行时清单都是一致的——应用程序清单要求9.0.30729.1版本的msvcrt.dll,crt清单包含确认msvcrt90.dll为9.0.30729.1版本的条目

现在,一个问题。我们的应用程序使用的第三方DLL库与原始的msvcrt90.DLL版本9.0.21022.8相链接,并且有一个内部清单

在安装了两个版本的VS9 CRuntime的开发PC上,该应用程序可以正常工作。在我们第一次安装应用程序的“新”PC上,DLL无法加载

现在,我可以做一些欺骗-一个是将应用程序恢复到9.0.2-从原始源媒体上删除9.0.2 DLL。这是不可取的,因为9.0.3更可取。 或者我真的很努力地重建第三方库

此外,我非常确定,在我们的开发PC上,当第三方库请求旧dll时,它会被重定向到新dll——它们是二进制兼容的

应用程序清单和程序集旨在将我们所有人从这种垃圾中解救出来。
必须能够编辑程序集清单文件,以便可以加载exe和dll。

我从未尝试过,但我认为通过清单中的bindingRedirect可以解决这个问题,我知道它在托管世界中工作

参见示例(您需要更改版本的值)



这与我一直在尝试的非常接近。但是,在哪里以及如何放置该XML?我的应用程序有一个嵌入的.manifest文件,文档中说绑定重定向应该放在app.exe.config文件中。我已经创建了配置文件,将其放在我的应用程序文件夹中,没有发现任何差异。我甚至不确定它是否被使用。也许我需要确保assemblyIdentity与我的应用程序清单assemblyIdentity完全匹配。它需要在清单中,你可以将自己的声明添加到由VS生成的清单中,我这里没有VS,因此我无法给出确切的方法,但它位于project settings\manfirst Tool下的某个位置只是一些澄清:如果EXE具有必须重定向的依赖程序集,则本地策略文件的适当名称为:application.EXE.config-如果是具有需要重定向的依赖程序集的附属dll,然后策略文件名为dllname.dll.2.config-为什么是.2?我不知道。但它必须在那里。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
  <windows>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <assemblyIdentity name="Your.Application.Name" type="win32" version="9.0.0.0"/>
      <dependentAssembly>
        <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
        <bindingRedirect oldVersion="9.0.20718.0-9.0.21022.8" newVersion="9.0.30411.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity type="win32" name="Microsoft.VC90.MFC" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
        <bindingRedirect oldVersion="9.0.20718.0-9.0.21022.8" newVersion="9.0.30411.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity type="win32" name="Microsoft.VC90.MFCLOC" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
        </assemblyIdentity>
        <bindingRedirect oldVersion="9.0.20718.0-9.0.21022.8" newVersion="9.0.30411.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </windows>
</configuration>