Assembly Not Referenced in ASP.NET Application Using A Server Control - XHEO.com - .NET Know How
XHEO.com: .NET Know How   log in |    
Printer friendly
Assembly Not Referenced In ASP.NET Application Using A Server Control
Article? Script!
Quick Stats
Created: 5/2/2003
Modified: 5/2/2003
Views: 6238 times

The information in this article applies to:

  • All Products

This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location from which you downloaded the release.

Symptoms

When you add a control to your ASP.NET WebForm you may receive the following error:

CS0011: Referenced class 'XXXXX' has base class or interface 'YYYYY' defined in an assembly that is not referenced. You must add a reference to assembly 'ZZZZZ'.

Cause

When you first add a control XXXXX to your web form Visual Studio .NET adds a reference to the assembly that contains the control ZZZZZ. The Xheo controls are installed in the GAC for better design time support, however Visual Studio .NET has trouble managing these assemblies. The control will work fine in the designer but when you browse the page that contains the control, you receive the error message above. When the reference was added Visual Studio .NET sets the Copy Local property to false (the default). When false, the assembly is not copied to the local \bin folder of the application. Since ASP.NET does not check the GAC for assemblies, it will be unable to find the control.

Resolution

You must set the Copy Local property of the referenced assembly ZZZZZ above to true. This will copy the assembly to the ASP.NET application's bin folder.

Status

This is a known limitation of Visual Studio .NET. Future versions may resolve this, but there is no public plans to do so.

Copyright (C) XHEO. All Rights Reserved.