This morning, on coming back into work, and trying to “Build Web Site” on a web service we have in-house, I have encountered this issue:
------ Build started: Project: C:\...\SyncWcfService\, Configuration: Debug Any CPU ------
Validating Web Site
vbc : Fatal (0,0): error BC2000: compiler initialization failed unexpectedly: Unable to find required file 'Microsoft.VisualBasic.dll'.
Validation Complete
It’s the first time I’ve loaded the project, but another colleague has the same issue, and he has successfully run it in the last month.
Lots of copies of the file exist (lots of different versions too) and it exists in the GAC:
The Global Assembly Cache contains the following assemblies:
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Clean and rebuild did not work. Nor did removing all temp files, and Google has not helped significantly (it recommended reinstalling the .net framework, but the issue has appeared on at least two machines, which strikes me as being unlikely to be a framework issue). Detailed diagnostic build only produces the output above.
I’m at a loss. Anyone got any ideas?
UPDATE: Procmon reports:
09:00:41.5420355
devenv.exe
5588
CreateFile
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vbc : Fatal
NAME NOT FOUND
Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
Which helps a little (thanks Jeremy), but which seems to show that it is trying to create a file called “vbc : Fatal”. At no point did I find anything to do with Microsoft.VisualBasic.dll
UPDATE: It seems to have been caused by clearing out assemblies in web.config.
If I remove the line <clear /> from compilation -> assemblies, the error goes away.
Look in the compilation section of your web.config. Is there anything unusual?
Try replacing the entire compilation section with:
Does the project validate?
Is so, add the offending lines back in one-by-one until the error re-appears.