views:

393

answers:

6

Can anyone help me figure out what the problem is. I am trying to start up a C# winformsa app in visual studio and i keep getting this error:

Could not load file or assembly, Foo.dll version1.93343 or one of its dependencies The system can't find the file specified

vs 2005, C# 2.0

any help

A: 

You must have a reference to Foo.dll somewhere and it can't be located (duh). Do you see a reference in the solution window? You can right click that and select "properties" to look at the path.

Ed Swangren
A: 

Do you see an exclamation mark on a reference in visual studio's solution explorer ?

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

Canavar
+1  A: 

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

I've often found that the assembly dll file that can't be loaded looks fine. However one of its dependencies (another assembly dll) does not exist or has been moved.

When the CLR loads an assembly it will also check that all of that assemblies dependencies exist. In XCopy deployment this normally means you need all the dependency assemblies in the same directory as your application exe.

Try loading the winforms executable into Reflector and under "yourApp.exe" expand the References node to see what the other referenced types are.

Ash
+1  A: 

Fire up Fuslogvw.exe and inspect which assembly (or reference) can't be found.

Gerrie Schenck
+1  A: 

Typically it's about one of your references' reference, possibly deep down in the dependency tree. What I usually do is, fire up Sysinternals Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx), filter by process name, and run the app. It's typically fairly easy at this point to sift through the FILE NOT FOUNDs and locate the offending missing reference.

A: 

Worth checking your global web.config hasn't got a reference to that assembly

Hainesy