dcraig
2007-04-19 17:55:40 UTC
I'm having a problem with user controls in the VS Designer. Recently I had
my machine upgraded and, of course, had to reinstall Visual Studio.
Specifically, I have many forms which host user controls which I have
extended from the base classes such as textboxes and datagrids. My problem
is that, while the project compiles fine, if I open the forms in the
designer it deletes all my user controls from the form and I get the error
message;
"Could not find type 'ClioShared.clsAddressLinesGrid'. Please make sure
that the assembly that contains this type is referenced. If this type is a
part of your development project, make sure that the project has been
successfully built." (Or the same with different user defined controls)
I have had this problem before with the old machine but always managed to
work around it by changing the declaration and instantiation to include the
dll name (or remove the dll name), but this no longer works. The dlls are
in the references for the project, and the form does import the dll. For
example the above 'ClioShared' dll has been added to the references for the
project and at the top of the form 'imports clioShared'.
There is a 'hotfix' (KB: 842706), but I was told by MS that it is included
in SP 1, which I already have. From reading the forums and googling around
I see that this is a common problem and it probably has multiple causes.
What I've tried so far;
Removing and then adding the references to the dll (ClioShared) to the
project containing the form.
Changing the reference in the declaration and instantiation to include the
dll name (eg: changing 'Dim ctbTextBoxName As new clsAddressLinesGrid' to
'Dim ctbTextBoxName As New clioShared.clsAddressLinesGrid' and the same for
the instantiation).
One possible complication is that I also have installed SQL Server
Management Studio 2005, although I don't see any reason for that to cause
problems.
Environment:
XP Pro SP Version 2002 SP 2
Visual Studio 2003 1.1.4322 SP 1
Visual Source Safe 6.0d
my machine upgraded and, of course, had to reinstall Visual Studio.
Specifically, I have many forms which host user controls which I have
extended from the base classes such as textboxes and datagrids. My problem
is that, while the project compiles fine, if I open the forms in the
designer it deletes all my user controls from the form and I get the error
message;
"Could not find type 'ClioShared.clsAddressLinesGrid'. Please make sure
that the assembly that contains this type is referenced. If this type is a
part of your development project, make sure that the project has been
successfully built." (Or the same with different user defined controls)
I have had this problem before with the old machine but always managed to
work around it by changing the declaration and instantiation to include the
dll name (or remove the dll name), but this no longer works. The dlls are
in the references for the project, and the form does import the dll. For
example the above 'ClioShared' dll has been added to the references for the
project and at the top of the form 'imports clioShared'.
There is a 'hotfix' (KB: 842706), but I was told by MS that it is included
in SP 1, which I already have. From reading the forums and googling around
I see that this is a common problem and it probably has multiple causes.
What I've tried so far;
Removing and then adding the references to the dll (ClioShared) to the
project containing the form.
Changing the reference in the declaration and instantiation to include the
dll name (eg: changing 'Dim ctbTextBoxName As new clsAddressLinesGrid' to
'Dim ctbTextBoxName As New clioShared.clsAddressLinesGrid' and the same for
the instantiation).
One possible complication is that I also have installed SQL Server
Management Studio 2005, although I don't see any reason for that to cause
problems.
Environment:
XP Pro SP Version 2002 SP 2
Visual Studio 2003 1.1.4322 SP 1
Visual Source Safe 6.0d