En VS 2010 se creó un nuevo proyecto WinForm
. Se agregó un nuevo UserControl WPF.Error de VisualStudio?
2 errores en tiempo de compilación aparecieron:
Error 1 The type 'System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. D:\Projets\WindowsFormsApplication2\UserControl1.xaml.cs 20 26 WindowsFormsApplication2
Error 2 The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly. D:\Projets\WindowsFormsApplication2\obj\x86\Debug\UserControl1.g.cs 41 100 WindowsFormsApplication2
NB.
referencias como PresenationCore.dll
, PresenationFramework.dll
, se añaden WindowsBase.dll
automáticamente al añadir un nuevo WPF control de usuario al proyecto WinForm, ¿por qué no System.Xaml.dll
también?
==============
Bug informó sobre Microsoft Connect.
Bueno, como dice, considere agregar una referencia a System.Xaml. – mdm
@mdm ¿Por qué no debería agregar entonces 'PresenationCore.dll',' PresenationFramework.dll', 'WindowsBase.dll' – serhio