CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2001
    Posts
    391

    Question Visual Studio Web Forms Designer Error: File Could not be loaded

    I'm using MS Visual Studio .NET 2003. I created a new class which inherits from System.Web.UI.Page:

    public class MyPage : System.Web.UI.Page
    {

    }

    From the Solution Explorer i dclick the MyPage.aspx to go into the designer mode but get the attached error message.


    Any solutions?

    Tahnks.
    Attached Images Attached Images
    Last edited by quantass; March 3rd, 2008 at 03:07 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    18° 32' N / 73° 52' E
    Posts
    416

    Re: Visual Studio Web Forms Designer Error: File Could not be loaded

    By looking at the attached screenshot, the message reads that some reference is missing to the object.

  3. #3
    Join Date
    Sep 2004
    Posts
    1,361

    Re: Visual Studio Wen Forms Designer Error: File Could not be loaded

    Yeah, the IDE does some brain dead thing when you inherit from visual classes. 2005 does the same thing and I am not sure how to turn it off.

    The basic problem is that it append the namespace of your application (or a project folder as a namespace) when you make a new class. This messes up the IDE's ability to let you edit and make an inherited form. The fix is easy, just go into the two .cs files it makes and fix the namespaces.

    For example, lets say I have a user control called Person. Lets say I make a project folder call Employee and I wish to inherit from Person. I choose inherited user control and select person as the base class (and I do this from the Employee folder). You will get the error you describe.

    Just go into the employee.cs and employee.designer.cs and make sure the class's namespace is correct both in the namespace declaration and in the class definition. It has been a while since I have done this, but you will see that one or more namespace paths are wrong. Fix them and then the IDE will start to work again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured