Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't find System.Windows.Vector in C#
    primarykey
    data
    text
    <p>I'm making a Windows Forms application in Visual Studio 2010 Ultimate, but can't get the built-in Vector to work.</p> <p>Microsoft says that there is a <a href="http://msdn.microsoft.com/en-us/library/system.windows.vector.aspx" rel="noreferrer"><code>System.Windows.Vector</code></a> in the .NET Framework 4: </p> <p>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:</p> <p>The line <code>Vector v = new Vector(20, 30);</code> gives</p> <blockquote> <p>Compile error Error 1 The type or namespace name 'Vector' could not be found (are you missing a using directive or an assembly reference?)"</p> </blockquote> <p>I tried including a <code>using System.Windows</code> at the top but that didn't solve the problem.</p> <p>I went to References -> Add Reference to try to find something to add, but nothing was obvious.</p> <p>The problem may be: Also listed with <code>Vector</code> in the <a href="http://msdn.microsoft.com/en-us/library/ms599716%28v=VS.100%29.aspx" rel="noreferrer"><code>System.Windows</code></a> namespace, there are other classes like <code>Rect</code> or <code>Application</code>. I could use these as <code>System.Drawing.Rectangle</code> or <code>System.Windows.Forms.Application</code>, but <strong>none of these show up as part of some System.Windows namespace</strong></p> <p>I've tried different things for about 2 hours, and found <a href="http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/c32d6e27-0516-42bc-a065-e9ca99c72d78/" rel="noreferrer">this related post</a> (but Vector <strong>is</strong> part of .NET 4, so their fix doesn't seem worthwhile?) and <a href="http://social.msdn.microsoft.com/Forums/en-US/windowswic/thread/fdfff143-c1ae-41cd-bbeb-8ff6c1c879ec" rel="noreferrer">this possibly related post</a> but I do have .NET Framework 4 installed.</p> <p>Does anyone have an example of <code>Vector</code>? 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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload