The Designer could not be shown (error CS0234 I think)

Hitoruna

Member
Joined
Sep 12, 2017
Messages
11
Programming Experience
5-10
Today I received a C# solution. It includes multiple projects and multiple files. (Several screens- forms I guess)
I don't even want to build or run at this point. I just want to see the screens.

When clicking on a cs file (that i believe -but I am not sure- it is generated by the designer), I got:

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: Ptheclass --- The base class 'base1.subbase1.subsubbase1.Base.PaMenuBaseForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built

When I go to the file PaMenuBaseForm.cs (inside a Base folder) I got another designer error that says

The designer cannot process the code at line 33: this.paFooterPanel = new base1.baseLibrary.Gui.PaPanel(); The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.

When I go to the autogenerated code I got

C#:
using base1.baseLibrary.Gui;

namespace base1.subbase1.subsubbase1.Base
{

 private void InitializeComponent()
        {
            this.paFooterPanel = new base1.baseLibrary.Gui.PaPanel();


       }
}

As you can expect this gets a CS0234 error: the type or namespace name 'baseLibrary' does not exists in the namespace base1(are you missing an assembly reference?)

so, how can I solve this? I can see that the namespace base1.baseLibrary does not exist anywhere in the code. Perhaps is there a dll missing? If so where to put it?

(In the Solution explorer, References I can see that base1.baseLibrary is missing (with a yellow triangle and a !) among some other references. )

Any help will be greatly appreciated
 
Is that base1.baseLibrary.Gui.PaPanel control supposed to be defined in the project you're working on or another project in the same solution or elsewhere? Wherever it is supposed to be, VS can't find it. If it's in a separate third-party library then you need to download that library and reference it in your project. If it's in another project in the same solution then you may need to build that project first.
 
Is that base1.baseLibrary.Gui.PaPanel control supposed to be defined in the project you're working on or another project in the same solution or elsewhere? Wherever it is supposed to be, VS can't find it. If it's in a separate third-party library then you need to download that library and reference it in your project. If it's in another project in the same solution then you may need to build that project first.

To tell you the truth, I am not sure (this happens a lot in my job-sigh). The namespaces are included in the References section, I can see several of those (all of them missing). When I click on properties of these references, there is no a "path" or something similar.

I suspect that they are defined in (several) dlls, that I am going to get. So my idea is to put these dlls somewhere and then re-reference them in the project.
I guess I need to erase the references and reference them again. (I don't know if there is a way to modify the ones that are there in the solution explorer to point to the place where I will put them) .
 
So my idea is to put these dlls somewhere and then re-reference them in the project.
I guess I need to erase the references and reference them again.

That's about right.
 
Well, I got news.
I deleted and added again the necessary references. As a result:

*PaMenuBaseForm.cs (inside a Base folder) could be shown without problems (the second error in the original post dissappeared) .

However I still got the first one

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: Ptheclass --- The base class 'base1.subbase1.subsubbase1.Base.PaMenuBaseForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built


In the error list, I got no errors but one "message" which is the one quoted above. It is said that PaMenuBaseForm can not be loaded but this is showing without problems...

So I cleaned the project and build it.

Now, (with some minor problems I still don't understand) the screens are showing. Finally.

By the way, what are these "assemblies" they keep talking about??

 
Last edited:
Back
Top Bottom