Designer fails to load a valid Form (mess up with dependencies assemblies ?); (Unknown Type during OnMethodPopulateStatements.)
as Won't Fix
8/20/2008 2:54:24 AM
User(s) can reproduce this bug
As usual, the problem is the Designer that suddenly cannot load a Form any more.
I suspect a mess in loading dependent assemblies at design-time.
I had the problem with VS2005, and upgrading to VS2008 did not help.
I cannot send the project, which is big and private code, but I will try to decribe as precisely as possible.
3)What does not work
4)What I suspect
-I have in fact 6 projects, each one in its own directory. There is a tree of logical dependencies.
Project A depends on none. It is a DLL assembly
Project B depends on none. It is a DLL assembly.
Project Cab depends on A,B. It is a DLL assembly. Contains Windows Forms/User controls to be used in other projects.
Project Dab depends on A,B. It is a DLL assembly
Project Eabcd depends on A, B, C, D. It is a DLL assembly. Contains Windows Forms/User controls to be used in other projects.
Project Fabcde depends on a, b, c, d, e. It is an executable assembly
To handle the dependancies, I have used the regular way : each project is a VisualStudio "Solution", and I have attached "existing items" to this solutions, these items being the other projects.
Moreover, I have also added the assemblies in the references, using "Project > Common Properties > References >Add New references", then selecting the assembly in the "project" tab.
I usually only load the Fabcde Solution in VS, since, I can reach each project from there.
-Each project compiles very well
-The executable assembly runs without problem
-The projects Cab and Eabcd contains windows forms/user controls. I can open thoses forms/controls in the designer without problem
[3-What does not work]
-Project Fabcde contains Windows Forms/User controls that use custom controls from Cab and Eabcd. Suddenly, I could not open such forms any more, the designer claiming that a type from Eabcd cannot be found. It also claims that types form Fabcde itself cannot be found ?! (Which is the most stupid error)
-If I open a form of Fabcde that does not use custom controls, it loads ok in the designer, and the ToolBox contains my custom controls from Cab and Eabcd. But if I try to instanciate such a custom control fro mEabcd, it outputs an error
System.IO.FileNotFound exception : cannot load the assembly A. (The constructor from the custom controls actually makes calls to A).
As you can see, the only culprit is the designer that fails at loading assembies. However, he is alone to fail. Everybody else is able to find the assembly.
-Of course, I have tried to regenerate each project, to clear the ProjectAssembly cache, to add a FullTrust rule in the .NET config that points to the ProjectAssembly URL...
[4-What I suspect]
I suspect that the designer, for some reason, has a buggy way to resolve dependencies. Sometimes it works, sometimes it does not.