在C#中找不到System.Windows.Vector [英] Can't find System.Windows.Vector in C#

查看:983
本文介绍了在C#中找不到System.Windows.Vector的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个Windows窗体在Visual Studio 2010旗舰版的应用程序,但不能得到内置矢量工作。

I'm making a Windows Forms application in Visual Studio 2010 Ultimate, but can't get the built-in Vector to work.

微软说有一个 System.Windows.Vector 在.NET Framework 4:

Microsoft says that there is a System.Windows.Vector in the .NET Framework 4:

也许我做一些大的错误,但Visual Studio中抱怨试图以任何方式使用向量,它不'T拿出了智能感知自动完成:

Maybe I'm making some large mistake, but Visual Studio complains about trying to use Vector in any way, and it doesn't come up in the IntelliSense autocomplete:

向量v =新的向量(20,30);

编译错误错误1类型或名称空间名称'向量'找不到(是否缺少using指令或程序集引用?)

Compile error Error 1 The type or namespace name 'Vector' could not be found (are you missing a using directive or an assembly reference?)"

我试过,包括上方使用System.Windows 。但这并没有解决问题。

I tried including a using System.Windows at the top but that didn't solve the problem.

我去引用 - >添加引用,试图找到一些补充,但没有什么是显而易见的。

I went to References -> Add Reference to try to find something to add, but nothing was obvious.

该问题可能是:还与矢量中的 System.Windows 命名空间,还有其他类,如矩形应用。我可以用这些作为 System.Drawing.Rectangle System.Windows.Forms.Application ,但无这些显示为一些System.Windows命名空间的一部分

The problem may be: Also listed with Vector in the System.Windows namespace, there are other classes like Rect or Application. I could use these as System.Drawing.Rectangle or System.Windows.Forms.Application, but none of these show up as part of some System.Windows namespace

我已经尝试不同的东西约2小时,发现的此相关的帖子(但是Vector的 .NET 4的一部分,所以他们的修复似乎不值得吗?)和的这可能与帖子但我有安装了.NET Framework 4中。

I've tried different things for about 2 hours, and found this related post (but Vector is part of .NET 4, so their fix doesn't seem worthwhile?) and this possibly related post but I do have .NET Framework 4 installed.

有没有人有一个例子矢量?我知道我可以找第三方类,但我觉得我失去了一些东西,并希望了解/贴有其他人使用Google同样的问题的解决方案。

Does anyone have an example of Vector? I know I could get a third party class, but I feel I'm missing something, and want to learn/have the solution posted for other people googling the same problem.

推荐答案

添加到 WindowsBase 。结果
中的向量类中定义/参考在System.Windows命名空间内的WindowsBase.dll中装配。

Add a reference to WindowsBase.
The Vector class is defined in the WindowsBase.dll assembly within the System.Windows namespace.

这篇关于在C#中找不到System.Windows.Vector的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆