2010-12-08 13 views
34

VS 2010で新しいWinFormプロジェクトが作成されました。新しいUserControl WPFを追加しました。VisualStudioのバグ?

2コンパイル時にエラーが登場:

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。 PresenationCore.dllPresenationFramework.dllよう

参照すぎのWinFormプロジェクトに新しいWPFユーザーコントロールを追加し、なぜないSystem.Xaml.dllとき、WindowsBase.dllが自動的に追加されますか? Microsoft Connectに報告

==============

バグ。

+4

さて、System.Xamlへの参照を追加することを検討してください。 – mdm

+0

@mdmなぜ、「PresenationCore.dll'、 'PresenationFramework.dll'、' WindowsBase.dll'を追加しないのですか? – serhio

答えて

54

あなただけの、これはVSのバグであるかどうかを再System.Xaml.dll


への参照を必要とするように聞こえます。よく、テンプレートに追加できると思います - 再現できるので価値がありますlogging on connect

+0

はい、しかし、その参照は、PresentationCoreのようなWPF Conrtolに自動的に追加されません。 – serhio

+0

@serhio - あなたは質問を編集しました。もともとは、それを修正する方法を知っていると思って何かがありました。 –

+0

@Marc編集しましたが、タイトルを変更したことはありません。 – serhio

11

このプロジェクトは.NET 3.5から.NET 4.0に移行されましたか?はいの場合、インターフェイスは現在System.Xamlにあり、参照する必要があります。私の場合は

+0

あなたは質問を読んでいますか? "ちょうど作成された" – serhio

+0

私はそれを逃した.. :( –

0

「System.Xaml」が自動的にプロジェクトに追加が、エラーの同じタイプを与えていた。

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,.... .' Consider adding a reference to that assembly.

私はちょうどから「System.Xaml」を削除する、ことによって、問題を解決してきました参照であり、再びフレームワークからそれを加えています。

関連する問題