G
Guest
I created my own DbConnection class
using System;
using System.Data;
using System.Data.Common;
using System.Xml;
namespace MyNS
{
public sealed class MyConnection : DbConnection, ICloneable
{
// code implement DbConnection and ICloneable
...
}
}
But Visual Studio 2005 keeps complaining when I try to open this file as
follows:
One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.
The designer must create an instance of type
'System.Data.Common.DbConnection' but it cannot because the type is declared
as abstract.
Hide
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
I also see the icon for the file changes and if I remove the DbConnection
that MyConnection is inherited from. It is working fine.
Any ideas about this.
using System;
using System.Data;
using System.Data.Common;
using System.Xml;
namespace MyNS
{
public sealed class MyConnection : DbConnection, ICloneable
{
// code implement DbConnection and ICloneable
...
}
}
But Visual Studio 2005 keeps complaining when I try to open this file as
follows:
One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.
The designer must create an instance of type
'System.Data.Common.DbConnection' but it cannot because the type is declared
as abstract.
Hide
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
I also see the icon for the file changes and if I remove the DbConnection
that MyConnection is inherited from. It is working fine.
Any ideas about this.