Recently, when I was trying to run any web application project, I was getting the following error message:
CS0006: Metadata file 'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll' could not be found
So, I searched the net for solution, and this is how I was able to solve it:
First, check whether "System.EnterpriseServices.dll" file actually exists at that folder or not. You cannot navigate to the GAC_32 folder using windows explorer. You have to use command line to go there. From start menu, select 'Run' > type 'cmd' press enter. then directly go there:
cd C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a
press enter. then use dir /p command to see all files in it and search for the "System.EnterpriseServices.dll" file if you cannot find it there, then again go to this location:
cd C:\Windows\Microsoft.NET\Framework\v2.0.50727
press enter. From here you have to copy the file to the desired location. Use this command:
copy System.EnterpriseServices.dll C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a
Now try to run that web project from visual studio, and it should work. If it doesnt work, and gives you another error: CS0009 compile error, then you have to copy all the files to that folder. First navigate to that source folder:
cd C:\Windows\Microsoft.NET\Framework\v2.0.50727
press enter. Then use this command to copy all DLLs:
copy *.dll C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a
You dont need to overwrite any file that already exists at the destination folder. This should solve CS0009 error.
Subscribe to:
Post Comments (Atom)
22 comments:
Awesome!
thanks.
God Send, I have been fighting this for 3 HOURS!
You Rock
You saved me a lot of time! Thank you!
Thanks mates... I am glad that I was able to help. :)
BLESS YOU SIR! I can't believe how long I searched for this and how stupid easy it is to fix. Everyone else is all re-intallling windows and nonsense. I was using VS2010 having upgraded a VS2008 web services project on my home box. I didn't even have .Net2.0 pre sp2. Oy. THANKS!
Worked like a charm. Thanks so much...
what does one do in a hosted environment? I have spend an hour on the phone with them and cant get any resolution.
Worked grt for me,took hardly 2 mins:) thanks mate
I had the problem mentioned. And it was solved following the steps. Thanks for the post!
thanks my friend
very very thanks....
Very very thanks......
Excellent... Buddy THANKS A LOT...
I ran into this error deploying an application created in VS 2010 (on a different workstation) to a Server 2003 IIS 6 staging server that had previously hosted .Net 2.0 and 3.5 web apps. I'm not sure why the error occured this time, but your solution worked exactly as described. I had to copy all dll's. Thanks!
Thanks very much for this, didnt think to check see where the command line can go and windows explorer cant.
thanxxxx yaar
Thanx! this is just great!!
Thanks a lot, this fixed my issue!
YOU DA MAN!
Thanks a lot, this fixed my issue!
YOU DA MAN!
Worked As Advertised!
Great work
@Everyone: Thanks... I m glad I could help.
@Kevin T Parker: For hosted environments, I guess, you need to republish the website from a PC where you have visual studio (after fixing the dll copying), and then host it again.
Post a Comment