I use csc / csc2.exe to manually compile the application. I need to reference DLL.NET 3.5, however it seems that the compiler also automatically adds DLL.NET 4.0 (which causes a conflict).
I manually reference the desired version of mscorlib and other system DLLs. Compilation from Visual Studio succeeds, but compiling the same answer file manually from the command line fails.
/nostdlib+
/platform:AnyCPU
/errorendlocation
/highentropyva-
/reference:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll"
/reference:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll"
/debug+
/debug:full
/out:obj\Debug\Target.exe
/ruleset:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset"
/target:exe
/utf8output
Program.cs Properties\AssemblyInfo.cs
I get the following errors for each reference assembly:
error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll' and 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll'. Remove one of the duplicate references.
What makes the compiler include DLL.NET 4.0 and what can I do to prevent it from being included?
UPDATE:
MSBUILD, ( ) . , , # 6.
Mono MCS, Roslyn. MCS, # 6.
MSBUILD - #. , .