Reputation: 1319
When using the Assembly Binding log viewer to examine what is causing the FileNotFoundException error when I run my c# application I got the following in one of the error log files:
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.
I tried to use binding direct in the app.config file:
<?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>
but the same error occurs. I tried to search for the dll file msvcm90 but could not find version 9.0.30729.4974 (maybe because its old). Any other ways to resolve this issue? Thanks.
Upvotes: 0
Views: 2409
Reputation: 941208
You have a dependency on the managed C runtime support DLL that shipped with VS2008. The version you supplied is very old and does not belong in the directory you put it, it needs to be deployed into the Windows side-by-side cache (c:\windows\winsxs). Delete the file first, you might get lucky.
Best thing to do is to ask the owner of the product or DLL that uses this support DLL for the proper install procedure. Next best thing is to install the VC++ support runtime libraries, you can download the installer from here. I don't know if it the correct version, there have been a lot of security patches since it was released. Run Windows Update after installing it.
Upvotes: 1