Cannot view subclassed Page in Visual Designer

G

Guest

When I create a BasePage class in either the same or separate assembly,
create a Web Form that inherits from BasePage, and then attempt to view my
Web Form in the visual designer, I get the following error:

----------

The designer could not be shown for this file because none of the classes
within it can be designed. The designer inspected the following classes in
the file:

WebForm1 --- The base class 'SubclassPage.BasePage' could not be loaded.
Ensure the assembly has been referenced or built if it is part of the project.

----------

This problem seems only to occur with Visual Studio 2003 on Windows XP. I'm
not sure whether its related to the service pack of either product.

Other posts with the same problem exist, and I have scoured the web, however
I have not seen a solution to the problem.

Has anyone solved this issue?

Thanks
 
K

Karl Seguin

I assume your base class is abstract. It's a known issue. In order the
work, the visual designer [attempts] to create an instance of all relevant
classes...this is obviously not possible for abstract class. The best
option is to make your base class non-abstract...or use some other
technique..such as composition...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
G

Guest

Cheers for the reply Karl.

My base class is not abstract. The simplest of examples replicates the
problem. Do you know of a solution? A Web Form inheriting from a base page
class runs fine, its just the designer that is the problem.
 
K

Karl Seguin

No, I've tried the simple setup and the designer works fine for me. That
specific error, as I said, is known to happen when the base class is
abstract. I've not seen anyone else report it under different situations.
Have you tried it on a different machine? You are welcomed to zip up a
simple example and mail it to my email (remove all the removes ;) )

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
G

Guest

The solution that solved this problem for me was to adjust the Local Intranet
Zone's Trust Level to Full Trust in the .Net Configuration Tool. Just in
case, it can be found under Administrative Tools in the Start Menu. I'm
assuming that as my home directory is on a mapped network drive, the .Net
Code Access Sucurity Runtime was disallowing access.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top