相关文章推荐
聪明的领带  ·  jpa Page 1 of 0 ...·  2 年前    · 
力能扛鼎的剪刀  ·  Kafka Server - Could ...·  2 年前    · 
奔放的打火机  ·  mysql ...·  3 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

As I know, Point are exist in namespace System.Drawing , but Visual Studio can't find it.

using System.Drawing;
class Flower
    public Point Location { get; private set; }

Error: Can't find name of type or namespace "Point"

Edit 1: .Net 4.5.1

what .NET Framework are you using? Also did you try to add the assembly reference to System.Drawing.dll? – Ahmed ilyas Mar 14, 2014 at 23:32 Yes, it works, thanks. I'll upvote it in a few minutes of the technical reason. But why I should do it by hands. I thought, that when I write using System.Drawing, it must work without additional configuration. – Amazing User Mar 14, 2014 at 23:45 I can have MyNamespace.MyType in an assembly that's installed, but unless that assembly is references, I can't use it. Some framework assemblies are added by default for convenience. – jdphenix Mar 14, 2014 at 23:47

As others have indicated, you are missing a reference to System.Drawing in your project. The reason this works in some project types and not others is that some project types, specifically Windows Forms projects, will automatically add the reference to System.Drawing for you. While other project types like Console App, Class Library, or WPF Application do not automatically have that reference, so you have to manually add it.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.