I normally write my ASP.NET apps with C#.  With my current project, I’m supporting extensions to it, so I decided to test them with extras written in other .Net languages: VB and J#.  I wrote one in J#, and it worked just fine.  I wrote one in VB, and it bombed with this error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: The compiler failed with error code 2000.

Show Detailed Compiler Output:

C:WINDOWSsystem32> “c:windowsmicrosoft.netframeworkv1.1.4322vbc.exe” /t:library . . .

Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322.573
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

vbc : Fatal error BC2000 : compiler initialization failed unexpectedly: Cannot change thread

mode after it is set.

Upon further investigation, anything written in VB.Net running against ASP.NET produced this.  Even the simplest, nothing page with Language=”VB” produced this error.  Researching this problem on Google produced some others who have had this problem with Win XP and ASP.NET 1.1.  They resolved it by uninstalling and reinstalling IIS and then reregistering the aspnet_isapi.dll.  I have been hesitant to do this because of the possibility of having to reinstall VS.  Unlikely, but I don’t have the setup files with me, so it would present a problem.  In 3 days I’ll be back at home where I have the setup files, so I’m going to try it now so I can test out .Net Nuke (which is written with VB).  So, here I go *crossed fingers on my knees praying to God*. . .

Done!  It worked.  I can use VB.Net again!  I’m glad I backed up my IIS configuration because the reinstall cleared it, but a simple restore, and it’s as if I never did anything.  .Net Nuke is up and running. 

This was a very curious problem indeed.  Why were VB pages the only ones affected?  Maybe we’ll never know. . .  🙂