我正在尝试在 visual studio 2013 中使用自定义标准库,但似乎无法弄明白。我在命令行上使用/nostdlib 进行编译没有问题,尽管我希望能够在 IDE 中利用智能感知。我删除了除我的自定义 corelib 之外的所有引用,并且由于有两个 mscorlib 变体,我遇到了代码冲突错误。
VS 文档说:
To set this compiler option in the Visual Studio development environment
Open the Properties page for the project.
Click the Build properties page.
Click the Advanced button.
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>
关于c# - 如何从 visual studio 2013 中禁用 mscorlib.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26622951/