Visual Studio Generators - C# compiler option -nostdlib should be converted into NoStdLib MSBuild property not NoStandardLib
Currently -nostdlib option added in C# project results in generation of csproj file with NoStandardLib properties added. NoStandardLib indeed is property which is often described on MS documentation however it looks that valid MSBuild property is rather NoStdLib. See: https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties?view=vs-2022 (page is for VS2022 but it is the same down to VS2012).
Although it looks to work as MSBuild properly translates it into -nostdlib compiler option, but in fact MSBuild still adds /reference:/mscorlib.dll What results in warnings/errors when project is intended to be "custom mscorlib":
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /nostdlib+ /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll ....
When NoStdLib is used in csproj then MSBuild correctly calls compiler without additional reference to mscorlib.dll from framework:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /nostdlib+ ....
Fix looks as relatively simple - all v_CSharp.json files in Templates/MSBuild/FlagTables should be updated.
Potential workaround could be passing NoStdLib property to MSBuild:
cmake --build . --config Release -- /p:NoStdLib=true
But this works only while building from command-line and not if generated project/solution is opened in Visual Studio