Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileNotFoundException thrown for a referenced assembly

I'm getting a really weird FileNotFoundException thrown the first time I try to use a class defined in an assembly I have referenced. The assembly hasn't changed, and the location in the project file corresponds correctly to the physical path on disk.

This suddenly started failing in a solution that consists of two library projects, a windows service project and a console application, when I added installers to the windows service and a setup project. However, I have the console app as a single startup object, there are no references in either way between the console application and the service/installer projects.

like image 998
Tomas Aschan Avatar asked Jul 13 '10 14:07

Tomas Aschan


1 Answers

If you enable Assembly Binding Logging, you will find that the FileNotFoundException will contain within it the complete fusion probing log for the missing file. Normally this makes the problem pretty obvious straight away.

See http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx

like image 163
piers7 Avatar answered Sep 25 '22 16:09

piers7