Reputation: 196781
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
Upvotes: 7
Views: 27674
Reputation: 6555
Worth checking your global web.config hasn't got a reference to that assembly
Upvotes: 0
Reputation:
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.
Upvotes: 8
Reputation: 22368
Fire up Fuslogvw.exe and inspect which assembly (or reference) can't be found.
Upvotes: 2
Reputation: 62145
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.
Upvotes: 1
Reputation: 48098
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.
Upvotes: 0
Reputation: 124760
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.
Upvotes: 0