Compile Error B30392

Hi,

I have posted this on a number of sites (DNN sites, other VB sites, Wrox, etc.). On an IIS site it was suggested that this problem has to be related to the VB build process, i.e. that VB is the central culprit. So I am posting it here. If you think there is a better site please so indicate. The following is long so please bear with me.

I recently installed VS 2005 and DotNetNuke 4.02 (the ASP.NET 2.0 version). I got a very perplexing error (BC30392) trying to compile DNN 4.02 so I am attempting to build a small test web site unrelated to DNN using VB.NET to try to determine the cause of the problem.

The complete error message is:

Compiler Error Message: BC30392: 'Catch' cannot catch type 'exception' because it is not System.Exception' or a class that inherits from 'System.Exception'.

I can supply more details if needed.

Here is the test scenario:

My operating system is Win XP SP2 with IIS 5.1. I did the full installation of VS 2005 which also installed ASP.NET 2.0 and the 2.0 version of the .NET Framework.

I am getting a compilation error (BC30392) related to this code:

Try
Label1.Text = "Button Click Event Fired. Label Updated."
Catch ex As Exception
Label1.Text = ex.Message
End Try

For some reason Exception is not recognized as part of the System namespace during a build and error BC30392 is returned. This is not always the case. Here are several different experiments that get different results. The problem seems related to IIS 5.1 and VB.NET. IIS folks say is has got to be VB that is the problem.

  1. I created an HTTP web site using the template in VS 2005. When a build is run in VS 2005 error BC30392 is issued. If the application is run, IIS 5.1 shows the same error in the web page.
  2. If create I another identical web site using File System (the VS development web site) and execute a build in VS 2005 there are no errors. This is also the case if I switch to an IIS 5.1 web site by selecting the WebSite menu, choosing Start Options, and the Use Custom Server on the Property Pages dialog. However if I run the application (with or without debug) I get the BC30392 error on the IE web page.
  3. If I change the above code to use System.Exception, I get no errors under 1 or 2 above.

This appears to be related to IIS and VB but I am unable to determine what is causing the problem. Note that my web sites are set up with ASP.NET 2.0, that IntelliSense seems to recognize that Exception is part of the correct namespace even though the build produces the BC30392 error, and also if I create the exact same web site using C# I do not get any errors!

Some additional facts may be relevant. This is an older machine with lots of legacy stuff. For example two versions of VS, SQL Server, and Delphi. VS 2003 has always run with no problem. It has an older AMD Athlon processor. I have found no one who has seen this problem. My business partner does no development. He had only Win XP SP2 and MS Office loaded so I installed IIS 5.1 and VS 2005 as an experiment and built a small test web site with no problem!

I would appreciate anybody's opinion on how difficult it might be to eventually solve this problem. We have an MSDN subscription and could throw this at a Microsoft support team I suppose but I doubt that they could put together an environment that can reproduce the problem. My brute force fallback position is to buy a new machine and run all my new stuff (VS 2005, SQL Server 2005, etc) on it and use this older machine for legacy stuff. I know that will work and I can get back to productive work. Still, it would be nice to know what is causing this! Could it be something simple

Any help would be very much appreciated.



Answer this question

Compile Error B30392

  • normbuck

    Can you search your project for any Classes or Structures that are named "Exception"

    You are most liketly getting this error because some code either in you Imports or in the Name resolution path is also names "Exception" and the compiler is using that one instead.

    The most simple way to try to search would be to open your project in VS and right click on the "Exception" that has the error and select "Find References" or "Go to definition"

    Please report back to us your results so that we can help you address the issue.

    Hope this helps,



  • KaBob

    I am reading the error message and it not saying that exception is not defined. It is saying it is an exception that it can not catch with system.exception. Did you follow all the instructions in the read me file There are permissions you have to give the directory for dot net nuke to work. You also need to either add a database or change the connection string.


  • Compile Error B30392