简体   繁体   English

使用csc.exe 4.0定位不同的.NET平台

[英]Targeting different .NET platform with csc.exe 4.0

I had installed .NET 4 on my system and found that the produced exe is using CLR 4.0. 我在系统上安装了.NET 4,发现生成的exe正在使用CLR 4.0。 Is there an option with the csc.exe to target CLR 2.0? csc.exe是否有针对CLR 2.0的选项?

I am using Notepad++ currently. 我目前正在使用Notepad ++。 (SharpDevelop works but I need to know how it works) (SharpDevelop可以工作,但我需要知道它如何工作)

Like I can select c# version and .NET version in sharp develop. 就像我可以在快速开发中选择C#版本和.NET版本一样。

Thanks. 谢谢。

You can use /noconfig /nostdlib and then explicitly reference the .NET 2.0 assemblies (in c:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727 for example). 您可以使用/noconfig /nostdlib ,然后显式引用.NET 2.0程序集(例如,在c:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727中)。 It looks like the /lib command line option can make this slightly easier by letting you specify a directory to look in for references 看起来/lib命令行选项可以让您指定要查找引用的目录,从而使此操作稍微容易一些

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

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