C#编译器:/ nostdlib选项 [英] C# compiler: /nostdlib option

查看:280
本文介绍了C#编译器:/ nostdlib选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这怎么可以不编制时,它包括STDLIB(mscorlib.dll中)我的C#应用​​程序?据我所知,所有的类都继承System.Object类,这是在mscorlib.dll中定义。更重要的是 - 类型,如int只是别名如对于System.Int32中,这是在mscorlib中也被定义。则该选项使用过?

How is this possible not to include stdlib (mscorlib.dll) to my C# application when compiling it? As far as I know, all classes inherit System.Object class, which is defined in mscorlib.dll. What is more - types such as int are just aliases e.g. for System.Int32, which are also defined in mscorlib. Is this option ever used?

推荐答案

是的,它由任何人来编译的程序不符合CLR的桌面版本上运行。像Silverlight的或微架构。他们有自己的mscorlib.dll中,当然与System.Object的定义。

Yes, it is used by anybody that compiles a program that doesn't run with the desktop version of the CLR. Like Silverlight or the Micro Framework. They have their own mscorlib.dll, of course with System.Object defined.

下面是一个示例Silverlight项目的编译器命令行:

Here's the compiler command line of a sample Silverlight project:

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 
  /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;SILVERLIGHT
  /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\mscorlib.dll" 
  etc...

这篇关于C#编译器:/ nostdlib选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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