Failed to load file or assembly error

Can someone help me figure out what the problem is. I try to run the winformsa C # application in visual studio, and I keep getting this error:

Failed to load the file or assembly, Foo.dll version1.93343 or one of its dependencies. The system cannot find the file.

vs 2005, C # 2.0

any help

+4
source share
6 answers

This is usually a link to one of the link links, possibly deep in the dependency tree. I usually run Sysinternals Process Monitor ( http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx ), filter the process name and launch the application. Usually at this stage it is pretty easy to sift through FILE NOT FOUND and find the missing link.

+7
source

This is the key part: "or one of its dependencies"

I often found that the assembly DLL file, which could not be loaded, looks great. However, one of its dependencies (another dll assembly) does not exist or has been moved.

When the CLR loads the assembly, it also checks for all dependencies between the assemblies. In an XCopy deployment, this usually means that you need all the dependency assemblies in the same directory as your exe application.

Try loading the winforms executable into Reflector , and in the section "yourApp.exe" expand the node links to see what the other types are.

+1
source

Run Fuslogvw.ex and check which assembly (or link) cannot be found.

+1
source

You must have a link to Foo.dll somewhere, and it cannot be located (duh). Do you see the link in the solution window? You can right-click and select โ€œpropertiesโ€ to view the path.

0
source

Do you see an exclamation mark in the link in visual studio explorer?

If so, then you need to remove it, and then add it again.

0
source

It is worth checking that your global web.config does not have a link to this assembly

0
source

All Articles