C# 程序集引用与找到的程序集定义不匹配
当我运行c#应用程序时,使用程序集绑定日志查看器检查导致FileNotFoundException错误的原因时,我在其中一个错误日志文件中得到以下信息:C# 程序集引用与找到的程序集定义不匹配,c#,file,dll,assemblies,match,C#,File,Dll,Assemblies,Match,当我运行c#应用程序时,使用程序集绑定日志查看器检查导致FileNotFoundException错误的原因时,我在其中一个错误日志文件中得到以下信息: LOG: Post-policy reference: msvcm90, Version=9.0.30729.4974, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: Did not find assembly in DEVOVERRIDE path C:\Documents
LOG: Post-policy reference: msvcm90, Version=9.0.30729.4974, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Did not find assembly in DEVOVERRIDE path C:\Documents and Settings\All Users\Application Data\Red Gate\.NET Reflector\DevPath
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///F:/Stuff/Muaz/Programming/C#/Spatial and Temporal Research/Spatial and Temporal Research/bin/Debug/msvcm90.DLL.
LOG: Assembly download was successful. Attempting setup of file: F:\Stuff\Muaz\Programming\C#\Spatial and Temporal Research\Spatial and Temporal Research\bin\Debug\msvcm90.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: msvcm90, Version=9.0.30729.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
我尝试在app.config文件中使用binding direct:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="msvcm90"
publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="9.0.30729.4974"
newVersion="9.0.30729.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
但同样的错误也发生了。我试图搜索dll文件msvcm90,但找不到版本9.0.30729.4974(可能是因为它很旧)。还有其他办法解决这个问题吗?谢谢 您依赖于VS2008附带的托管C运行时支持DLL。您提供的版本非常旧,不属于您放置它的目录,需要将其部署到Windows并行缓存(c:\Windows\winsxs)中。先删除文件,你可能会幸运的
最好的办法是向使用此支持DLL的产品或DLL的所有者询问正确的安装过程。下一个最好的方法是安装VC++运行时支持库,您可以下载安装程序。我不知道它的版本是否正确,自从发布以来,已经有很多安全补丁。安装Windows Update后运行它。谢谢,我在c:\wondows\winsxs中找到了dll版本,并将其复制到文件夹中。“程序集绑定查看器”中的日志文件现在没有错误,但我仍然收到错误:“System.IO.FileNotFoundException:无法加载文件或程序集“Autodesk.Navisworks.Timeliner.dll”或其依赖项之一。找不到指定的模块。”我在这里发布了:我仍然无法解析。我将尝试按照您告诉我的那样运行windows update,并查看结果程序集,这样的程序集将具有比msvcm90.dll更多的依赖项。验证许可证并与Autodesk联系以获取支持。