locked
VS2012 Pro - Advanced Build Setting for C# - Nostdlib setting is not showing up RRS feed

  • Question

  • I am working with a set of third party libraries and projects which rely on custom a mscorlib.dll but when I import these into my VS, the advanced build settings for C# does not show the switch for nostdlib and the build itself does not respond to the tag written into the projects XML setting nostdlib to true. I'm pulling my hair out here. Can anyone explain to me why this option isn't appearing in my version of VS? Everything I read says it should be listed in the advanced build settings, but it isn't there.
    • Moved by Caillen Wednesday, May 14, 2014 7:18 AM
    Tuesday, May 13, 2014 3:39 PM

Answers

  • "the advanced build settings for C# does not show the switch for nostdlib and the"

    Presumably that's because this option is used very rarely. And probably the proper way to do this would be to create a custom "target framework" (assuming it is possible).

    "and the build itself does not respond to the tag written into the projects XML setting nostdlib to true"

    Works fine here (VS2013). I added <NoStdLib>true</NoStdLib> in the project file and no build fails with errors such as:

    Program.cs(3,11,3,18): error CS0518: Predefined type 'System.Object' is not defined or imported
    Program.cs(5,26,5,32): error CS0518: Predefined type 'System.String' is not defined or imported

    Wednesday, May 14, 2014 6:15 AM

All replies

  • "the advanced build settings for C# does not show the switch for nostdlib and the"

    Presumably that's because this option is used very rarely. And probably the proper way to do this would be to create a custom "target framework" (assuming it is possible).

    "and the build itself does not respond to the tag written into the projects XML setting nostdlib to true"

    Works fine here (VS2013). I added <NoStdLib>true</NoStdLib> in the project file and no build fails with errors such as:

    Program.cs(3,11,3,18): error CS0518: Predefined type 'System.Object' is not defined or imported
    Program.cs(5,26,5,32): error CS0518: Predefined type 'System.String' is not defined or imported

    Wednesday, May 14, 2014 6:15 AM
  • Hi Patrick,

    I'm moving your question to Visual Studio General Questions forum where you could get better help.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, May 14, 2014 7:20 AM