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 Profilethen change it to.Net Framework 4.0
现在可以使用了
这篇关于在控制台应用程序下找不到 System.drawing 命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在控制台应用程序下找不到 System.drawing 命名空间
基础教程推荐
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
