Problems opening forms in designer when dataset is defined in another assembly

  • Thread starter Thread starter Magnus Bergh
  • Start date Start date
M

Magnus Bergh

I got a weird problem with designer. I have created a spearate assembly
(DLL) containing my dataset classes and other classes which are shared
bewteen the projects in the solution.

When I try to open any form that use the dataset class or any of other
classes in the referenced assembly I get varoius errors in designer.

Looks like every time I open VS I need to do a) Rebuild solution, b)
Clean Solution and then I can open the forms. Sometimes I need to mess
around with Rebuild/Build clear etc to finally make it possibe to open
the forms.

Everything might look fine and forms open as they should. Then I close
the project and repopen and same problem again.

Any ideas why I have these problems? I don't have any problems when
dataset and other classes is in the same project.

I can compile and deploy the solution with no problems and it runs fine.

Some examples of errors I get in designer:
"Unable to cast object of type
'Microsoft.CompactFramework.Design.UnsafeComponent' to type
'System.Data.DataSet'. "

"The variable 'FutDataSet' is either undeclared or was never assigned."
 
This is getting really annoying. Tried to recreate projects and solution
but didn't help.

Is there anythign special you need to do to have your dataset in a
separate assembly?
 
For those who like me has got the same problem (I have searched lot of
articles but not find any explanation), I found a solution:

In my assembly which contains the dataset class I also put some other
classes (including some form classes. The braindead designer did not
like this (even if code run fine at runtime). After moving the dataset
class out to a seperate dataset it now works fine.
 
Back
Top