Error BC30002 - Type XXX is not defined

前端 未结 5 1473
春和景丽
春和景丽 2021-01-17 11:54

OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.

The problem, wh

5条回答
  •  渐次进展
    2021-01-17 12:32

    Sounds like a pre compile issue, particularly because you mention that you get the error and then wait and it disappears. ASP.NET may be still in the process of dynamically compiling your application or it has compiled the types into different assemblies.

    With dynamic compilation, you are not guaranteed to have different codebehind files compiled into the same assembly. So the type you are referencing may not be able to be resolved within its precompiled assembly.

    Try using the "@Reference" directive to indicate to the runtime that your page and the file that contains your type should be compiled into the same assembly.

    @ Reference - MSDN

提交回复
热议问题