gpt4 book ai didi

.net - VisualStudio错误?

转载 作者:行者123 更新时间:2023-12-03 08:18:52 25 4
gpt4 key购买 nike

在VS 2010中创建了一个新的WinForm项目。添加了新的UserControl WPF。

出现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



注意。

当向WinForm项目添加新的WPF用户控件时,会自动添加诸如 PresenationCore.dllPresenationFramework.dllWindowsBase.dll之类的引用,那么为什么不也添加 System.Xaml.dll呢?

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

已在 Microsoft Connect 上报告了错误。

最佳答案

听起来您只需要引用System.Xaml.dll
关于这是否是VS中的错误;好吧,我想模板可以添加该引用-我可以复制它,因此值得logging on connect

关于.net - VisualStudio错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4387812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com