I m creating a C# .NET Project in which i m trying to load third party Assemblies which are installed in GAC.
But in some machines I m getting an error stating "Unable to Load assembly of specified version 7.0.351.0".
when i tried to do an assembly redirection it didn't work it still shows the same error.
Note: 7.0.351.0 -The is version with which it is compiled.
12.0.0.0 - Assembly present in the Target machine
Properties of Reference Specific Version -> False
Aliases -> global
Copy Local -> False
This is my sample application configuration file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyIdentity
name="Act.Framework"
p开发者_开发百科ublicKeyToken="ebf6b2ff4d0a08aa" />
<bindingRedirect oldVersion="7.0.351.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Logs of FUSLOGVW shows
"LOG: No application configuration file found."
But I already added the App Config file. Is it not detecting my config file?
How do I make it detect?
Steps I did to add App.Config file:
- Add New Item through Project wizard and select "Application Configuration file".
Check the path containing the web.config
. If your web.config
file is in a directory path that has one or more of folders named with a "#" in the name, Microsoft Fusion will completely ignore the web.config
for all assemblyBinding
entries.
Try specifying the culture of the assembly in your bindingRedirect:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Act.Framework"
publicKeyToken="ebf6b2ff4d0a08aa"
culture="neutral" />
<bindingRedirect oldVersion="7.0.351.0"
newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
You also need to verify that the new version of the assembly is signed with exactly the same private key as the old one.
As far as the the configuration file is concerned verify that it is called ABC.exe.config
where ABC
is the name of your executable and that it is in the same folder (if this is a windows application of course, for web applications you need to use web.config
).
精彩评论