在控制台应用程序下找不到 System.drawing 命名空间 [英] System.drawing namespace not found under console application

查看:34
本文介绍了在控制台应用程序下找不到 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.

推荐答案

  1. 右键单击控制台应用程序的属性.
  2. 检查目标框架
  3. 如果是.Net Framework 4.0 Client Profile,则将其更改为.Net Framework 4.0
  1. Right click on properties of Console Application.
  2. Check Target framework
  3. If it is .Net framework 4.0 Client Profile then change it to .Net Framework 4.0

现在可以使用了

这篇关于在控制台应用程序下找不到 System.drawing 命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆