微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 如何从visual studio 2013中禁用mscorlib.dll?

我试图在visual studio 2013中使用自定义标准库,似乎无法弄明白.使用/ nostdlib在命令行上编译没有问题,尽管我希望能够在IDE中利用intellisense.除了我的自定义corelib之外,我已经删除了所有引用,并且由于有两个mscorlib变体,我遇到了相互矛盾的代码错误.

VS文档说:

To set this compiler option in the Visual Studio development environment

  1. Open the Properties page for the project.

  2. Click the Build properties page.

  3. Click the Advanced button.

  4. Modify the Do not reference mscorlib.dll property.

虽然情况似乎并非如此,因为此选项不存在.有谁知道如何在vs2013中禁用mscorlib.dll?

解决方法

这是一个老问题,但实际上 – 当UI选项消失(或移动)并且文档仍然存在误导性时,您仍然可以通过添加< NoStdLib> True< / NoStdLib>来复制效果.进入高级设置中的其他选项附近的.csproj:
<Project Toolsversion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    ...
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <NoStdLib>True</NoStdLib>
    <TargetFrameworkProfile />
  </PropertyGroup>
...
</Project>

原文地址:https://www.jb51.cc/csharp/244780.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐