Error BC30002: Type XXX is not defined...

Problem

You receive this error when compiling your application:

Error BC30002: Type ‘XXX’ is not defined...

This usually occurs due to a bug in Visual Studio .NET 2003, though this may occur in other versions of Visual Studio .NET.  Visual Studio .NET maintains a cache of assemblies (DLLs) that sometimes becomes outdated and may contain references to old DLLs or DLLs that no longer exist.

This problem generally manifests itself when you upgrade to a new version of Iron Speed Designer with new versions of BaseClasses.dll.  Visual Studio .NET may have cached the older version of BaseClasses.dll, even though a newer version has been placed into your project folder.

Update Visual Studio .NET’s references

Step 1:  Open the application using Visual Studio .NET.

Step 2:  Delete the reference to BaseClasses.dll and BaseClasses.Web.Controls.dll in the References section.  (Note: BaseClasses.Web.Controls.dll is used in applications created by Iron Speed Designer V3.2 and earlier.  This DLL is not present in applications created by Iron Speed Designer V4.0 and later.)

Step 3:  Add back the references again to the BaseClasses.dll and BaseClasses.Web.Controls.dll in the References section.  (Note: BaseClasses.Web.Controls.dll is used in applications created by Iron Speed Designer V3.2 and earlier.  This DLL is not present in applications created by Iron Speed Designer V4.0 and later.)

Step 4:  Rebuild and run your application.  The error messages should go away.

Delete the Visual Studio .NET cache folder

Alternately, you may need to delete the Visual Studio .NET cache folder for your application directly in:

C:\Documents and Settings\<user.domain>\VSWebCache

Step 1:  Delete your application’s cache folder.

Step 2:  Rebuild and run your application.  The error messages should go away.

Shared folder conflicts

Another cause for this error occurs when a migrated application has an existing “Shared” folder.  If you attempt to add new pages to enhance the role based security feature, you may be denied access to the Shared folder.  Iron Speed Designer V3.2 and later creates a separate folder called “Security” for the Sign In and Sign Out pages.  The Sign In and Sign Out controls are placed in the Shared folder.  This approach was implemented to avoid circular dependency problems that might arise when controls and pages referring to these controls are in the same folder.

Create a new folder called “Security” and move your Sign In and Sign Out web pages to this folder before adding any customizations to them.

See Also

Part VII:  Troubleshooting Applications

Application Generation and Compilation Error Messages