VB 2005 Compile Error

I have an existing VS2K3 solution that contains a mix of C# and VB.NET projects. I've upgraded the solution to 2K5 Beta2 and I get the following error when compiling the solution. This error occurs when building a VB.NET project.

InternalMyTemplate.vb(173) : error BC30002: Type 'InvalidOperationException' is not defined.

This file is not part of my project, it appears to be related to the 'My' namespace.

I can't find any information on this particular error on the net. Does anyone have any ideas

Best Regards,
Travis G.


Answer this question

VB 2005 Compile Error

  • pico1079

     TraGib wrote:
    I have an existing VS2K3 solution that contains a mix of C# and VB.NET projects. I've upgraded the solution to 2K5 Beta2 and I get the following error when compiling the solution. This error occurs when building a VB.NET project.

    InternalMyTemplate.vb(173) : error BC30002: Type 'InvalidOperationException' is not defined.

    This file is not part of my project, it appears to be related to the 'My' namespace.

    I can't find any information on this particular error on the net. Does anyone have any ideas

    Best Regards,
    Travis G.


    Travis,

       Can you post a location to get your project so that the issue can be reproduced (and resolved )

              - Nicholas Paldino [.NET/C# MVP]
              - mvp@spam.guard.caspershouse.com

  • redman_12

    I found the problem.

    In the previous version (2003), the VB project's references were all removed and the individual imports statements were used where appropriate in each file (This was probably done to keep it similiar to the C# projects).

    After adding a project level reference to System, the project compiled successfully.

    While this worked in my case, maybe a better solution would be for the code generated to support 'My' namespace to include the Imports it needs to work rather than assuming they would be present as part of the project configuration. My $.02 anyway...

  • vherva

    That would be very difficult as it's a commercial application. I'll see what I can do about reproducing the problem in a different sample, but given the nature of the error, it doesn't seem likely. I'd be more than happy to work with someone at MS directly if necessary.


  • VB 2005 Compile Error