I have a .net visual studio solution with a number of projects (class libraries and a web application).
I did some refractoring which moved files between projects, created new projects, deleted ones not being used and renamed some existing projects.
The solution builds without an issue but when I run the web application, the following exception occurs:
"Could not load file or assembly 'XXX.YYY' or one of its dependencies. The system cannot find the file specified."
The project called XXX.YYY which was deleted in the refractoring outputed a dll called XXX.YYY. But this isnt used anywhere in the application. I deleted the web applications obj directory and bin folder and rebuild but it still occurs.
Anyone have any ideas when this might be occurring, any tips??
UPDATE:
Update on my issue. I took the code place to another computer and ran it from there and it built and ran successfully without this issue occurring. So this makes me think the issue is with my PC rather than the code base. Maybe there is something cached on my PC. I did delete my temp files at "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" but no luck.
So anything else that could be cached or any other reason for it to occur on my PC.
FURTHER UPDATE
Another update on this. I have ran the same code on other developers machine and he doesnt have an issue running it. So must definitely be something on my machine! The only different on our machine is that I am running IIS7 with the app's app pool in classic mode. The other developer is running IIS6.
2 new pieces on information. Firstly in my httpmodules in my web.config, I have to remove a custom http module, before adding it. The other developer does not have to do this. Secondly, I have been able to fix the "Could not load file or assembly 'XXX.YYY' or one of its dependencies" issue via a "hack" which is only a short term fix by creating a class library in my project called XXX.YYY and including the classes being looked for, which are all custom controls ie. inheriting from System.Web.UI.WebControls.WebControl.
Any further thoughts....
There are two possible reasons.
1) When you run your webapp, you still use the old assemblies somewhere on your machines. Your old assemblies were referencing the old assembly "XXX.YYY".
2) The latest binary you built is still referencing the old assembly "XXX.YYY".
To find out what assemblies your webapp using, if you are running a debugger, you can easily find it out from the output windows. It should be first few lines of the output. Another way to find out is to open the Module windows in VS.NET IDE during debugging.
If you cannot debug it for some reasons or you have problems to attach a debugger, another easier way to do is to use fuslogvw. It gives you the exact locations of all successfully loaded assemblis as well as the assemblies that it failed to load. Please make sure you run the fuslogvw as Administrator in Windows 7.
After you find out what assemblies your webapp successfully loaded, you can do ildasm on those assemblies to see what assemblies they are referencing. You need to check them one by one unfortunately.
My guess is that some of your successfully loaded assemblies are actually coming from somewhere in the ASP.NET cache or GAC.