C# 不能使用Windows引用

C# 不能使用Windows引用,c#,winforms,visual-studio-2012,reference,.net-4.5,C#,Winforms,Visual Studio 2012,Reference,.net 4.5,我正在尝试测试从MSDN站点找到的,但是在加载正确的引用时遇到了问题。我目前的目标是.NET 4.5。System.Windows之后的所有内容都会导致一个错误,即System.Windows中不存在最后5个。但是,当我检查引用列表/尝试添加它们时,没有列出任何引用(除了System.Windows) using System; using System.Windows; using System.Windows.Navigation; <--- From here down, none

我正在尝试测试从MSDN站点找到的,但是在加载正确的引用时遇到了问题。我目前的目标是.NET 4.5。
System.Windows
之后的所有内容都会导致一个错误,即
System.Windows
中不存在最后5个。但是,当我检查引用列表/尝试添加它们时,没有列出任何引用(除了
System.Windows

using System;
using System.Windows;
using System.Windows.Navigation; <--- From here down, none exist
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls;
使用系统;
使用System.Windows;

使用System.Windows.Navigation

>代码>动画TimeLINK< /Cord>类是Windows演示基础(WPF)的一部分。我怀疑您的项目是作为Windows窗体应用程序创建的。这些是非常不同的技术,通常不会将它们混合在一起,除非在特殊情况下

如果您查看链接到我们的同一MSDN页面,您将看到其内容如下:

程序集:PresentationCore(在PresentationCore.dll中)

因此,为了使用该类,必须添加对PresentationCore.dll的引用。您通常还希望至少为核心WPF功能引用PresentationFramework.dll和WindowsBase.dll


如果您只是在Visual Studio中创建一个新的WPF应用程序,它应该具有适当的引用。

您是否尝试添加对的引用them@PreciousTijesunimi我已经尝试过了,但是除了System.Windows之外,其余的都没有显示在列表中以添加它们。您是否尝试过浏览到实际的dll。如果它不在GAC中,它将不会显示在列表中。您确实意识到您正在混合winforms和Wpf,您需要将PresentationCore和PresentationFramework引用添加到您的项目中,或者直接转到工具箱中的Wpf互操作性,并将ElementHost添加到表单中,当您添加它时,它将带来Wpf引用。