C# 如何在 Visual Studio 2010 Express 中引用 system.drawing?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9450251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to reference system.drawing in Visual Studio 2010 Express?
提问by Jaghancement
I'm somewhat new to this and I am under the impression that to draw a rectangle that I've created, I need to use system.drawing.graphics. Thing is, I get the error
我对此有点陌生,我的印象是要绘制我创建的矩形,我需要使用 system.drawing.graphics。问题是,我得到了错误
"The type or namespace name 'drawing' does not exist in the namespace 'System' (are you missing an assembly reference?)"
“命名空间‘系统’中不存在类型或命名空间名称‘绘图’(您是否缺少程序集引用?)”
and when I right click the References folder in the solution explorer, system.drawing is nowhere to be found. So I'm not exactly sure how to move forward in drawing a rectangle.
当我右键单击解决方案资源管理器中的 References 文件夹时,找不到 system.drawing 。所以我不确定如何继续绘制矩形。
采纳答案by Brian Minnich
Namespace should be available to you no matter the version of VS2010. Right click "References", "Add Reference...", ".NET" tab, sort by component name and select "System.Drawing" and "OK".
无论 VS2010 的版本如何,命名空间都应该可用。右键单击“引用”、“添加引用...”、“.NET”选项卡,按组件名称排序,然后选择“System.Drawing”和“确定”。
If it doesn't show then you might want to look into your build properties on your project and see what framework you're targeting (2.0, 3.5, 4.0, etc...)
如果它没有显示,那么您可能需要查看项目中的构建属性,看看您的目标框架是什么(2.0、3.5、4.0 等...)

