简体   繁体   English

参考System.Windows.Forms

[英]Reference System.Windows.Forms

Inside a console application (.net 4.5 using vs 2013), it's just not possible for me to add a reference to this lib.(System.Windows.Forms). 在控制台应用程序(使用vs 2013的.net 4.5)中,对我来说,无法添加对该库的引用(System.Windows.Forms)。 Have started the new console proj many times from scratch to no avail. 从头开始多次启动新控制台项目,无济于事。 Any clues? 有什么线索吗? this seems like a very simple task... but well, it's anything but. 这似乎是一个非常简单的任务...但是,没什么。 (thanks) (谢谢)

在此处输入图片说明

NO there is no such issue with console application when we add reference with Windows.Forms library. 不,当我们使用Windows.Forms库添加引用时,控制台应用程序不会出现此类问题。

Close your visual studio and try again. 关闭您的视觉工作室,然后重试。

Well.... this was interesting. 好吧....这很有趣。 Started playing with the property settings and set the target framework to 4 client and was finally able to add the library. 开始使用属性设置,并将目标框架设置为4个客户端,最终能够添加库。 Tried to run and it didn't, then changed it back to .net 4.5 full and set the build platform target as x86 as someone suggested here on SO... and yes !! 尝试运行,但没有运行,然后将其更改回.net 4.5 full,并将构建平台目标设置为x86,就像有人在此处建议的那样……是的! it worked. 有效。 So, basically playing around with those settings got me running, but still think it might have been an environment issue and not the platform itself. 因此,基本上使用这些设置可以使我运行,但仍然认为这可能是环境问题,而不是平台本身。 ... thanks ! ... 谢谢 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM