Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable mscorlib.dll from within visual studio 2013?

I am trying to use a custom standard library in visual studio 2013 and can't seem to figure it out. I have no problems compiling on the command line using /nostdlib although I would like to be able to take advantage of intellisense in the IDE. I have removed all references except for my custom corelib and I am getting conflicting code errors due to having two variations of mscorlib.

The VS documentation says:

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.

Although this does not seem to be the case, as this option does not exist. Does anyone know how I can disable mscorlib.dll in vs2013?

like image 674
user1632018 Avatar asked Oct 29 '14 04:10

user1632018


1 Answers

This is an old question, but, indeed - while the UI option has disappeared (or moved) and the documentation remains misleading to this day, you can still replicate the effect by adding <NoStdLib>True</NoStdLib> into your .csproj near the other options found in advanced settings:

<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>
like image 182
YellowAfterlife Avatar answered Oct 16 '22 01:10

YellowAfterlife