System.drawing namespace not found under console application(在控制台应用程序下找不到 System.drawing 命名空间)
问题描述
我选择控制台应用程序作为我的 C# 项目.但是似乎在 Windows 窗体项目下工作的导入在这里似乎不起作用.它说绘图命名空间不存在.
I selected console application as my C# project. But the imports that seemed to work under Windows Form project don't seem to work here. It says that the drawing namespace does not exist.
using System.Drawing;
using System.Drawing.Imaging;
我的问题是我需要有位图类.我正在尝试制作一个对图像进行位图操作的命令行应用程序.这就是为什么我没有将我的项目选择为 Windows Form one.
My problem is that I need to have the bitmap class. I am trying to make a command line app that does bitmap manipulations to a image. That's why I didn't choose my project to be a Windows Form one.
推荐答案
- 右键单击控制台应用程序的属性.
- 检查
目标框架
- 如果是
.Net Framework 4.0 Client Profile
,则将其更改为.Net Framework 4.0
- Right click on properties of Console Application.
- Check
Target framework
- If it is
.Net framework 4.0 Client Profile
then change it to.Net Framework 4.0
现在可以使用了
这篇关于在控制台应用程序下找不到 System.drawing 命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在控制台应用程序下找不到 System.drawing 命名空间


- 使用 rss + c# 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01