C#编译器:/ nostdlib选项

编程入门 行业动态 更新时间:2024-10-27 10:27:33
本文介绍了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选项

本文发布于:2023-11-10 06:42:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574642.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编译器   选项   nostdlib

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!