Sorun: Windows Forms tasarımcısı, temel sınıf başka bir derlemeden bir arabirim uygularken, devralınan bir kullanıcı denetimi için çalışmaz.VS2010: Devralınan kullanıcı denetimleriyle çalışırken Windows Forms tasarımcısı sorunları nasıl önlenir?
Platformu: VS 2010 SP1, .NET 4.0 Framework
Hata:
MyInterfaceLib:
namespace MyInterfaceLib
{
public interface IMyInterface
{
void Foo();
}
}
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: MyControl --- The base class 'MyBaseControlLib.MyBaseControl' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager) at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
Ben 3 sınıf kitaplığı projeler ile bir çözüm var MyBaseControlLib:
namespace MyBaseControlLib
{
using System.Windows.Forms;
using MyInterfaceLib;
public partial class MyBaseControl : UserControl, IMyInterface
{
public MyBaseControl()
{
InitializeComponent();
}
public void Foo()
{
}
}
}
MyDerivedLib: tasarımcı MyBaseControl için çalışıyor
namespace MyDerivedControlLib
{
using MyBaseControlLib;
public partial class MyControl : MyBaseControl
{
public MyControl()
{
InitializeComponent();
}
}
}
rağmen MyControl için çalışmaz. MyBaseControl IMyInterface uygulamıyorsa, tasarımcı MyControl için de çalışır.
Herhangi bir fikrin var mı?
sayesinde Robert
bu anahtarı "temel sınıf 'MyBaseControlLib.MyBaseControl' yüklenemedi. Montaj başvurulan edilmiş ve tüm projelerin inşa edilmiş olduğundan emin olun." Değil mi ..? –
Benim (sınırlı) deneyimimde, VS sadece onları tüketirken aynı çözümde yaşayan kullanıcı denetimleri ve özel denetimler ile ilgili bir çok sorun var. "Uygunluk hırs seviyesi" ni düşürdüğümde ve bunu kabul ettiğimde ve kontroller için ayrı bir çözüm oluşturduğumda her zaman çok daha az sorun yaşadım. Daha sonra DLL'yi diğer projelerden referans alıyorum ve denetimleri kendim değiştirdiysem "derleme" yerine "rebuid" kullanıyorum. –