Visual Studio 2012 app could not load file or assembly

403 views Asked by At

The infamous Could not Load file or Assembly "filename.dll" or one of its dependencies.

I get this error when a client tries to run my mixed c/c++/c# app developed in VS2012. I used Process Monitor to see exactly which modules are not being loaded and got some weird results.

On the developer computer, where VS2012 is installed, everything runs fine. The client computer does not have any visual studio installed, however they do have .NET 4.0 and the Redistributable update.

For some reason when the program is run on the client computer, a handful of C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System(*.INI) files are queried. Since these are the only files that do not exist, I am fairly confident that this is the issue.

Now, why when ran on the developer computer are these files not queried, but when ran on the client computer these files become necessary?

1

There are 1 answers

1
Basem Sayej On

you can use the fusion utility(Assembly binding log viewer) to determing the problem run command prompt as admin, fuslogvw.exe this tool will help you determine all referenced assemblies calls in your program and including the broken references. it helped me a lot while trying to resolve some unmapped ioc registries.

you can learn more about it here http://msdn.microsoft.com/en-us/library/e74a18c4.aspx