这怎么可以不编制时,它包括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选项
发布评论