Each of .Net Framework version has own versions of csc.exe
, msbuild.exe
, etc. On my notebook all .Net Framework versions (newer than .Net 1.0) are installed. I see such directories:
I created some new Windows-variables:
%NET30% = "C:\Windows\Microsoft.NET\Framework64\v3.0"
%NET35% = "C:\Windows\Microsoft.NET\Framework64\v3.5"
%NET40% = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
and use them when I use csc.exe
, al.exe
and msbuild.exe
manually or through the BAT
-files (from the usual cmd.exe
). It allows to me compile my code sources on my notebook (it is not a "super car"), which hasn't Visual Studio, but has all necessary .Net Framework versions installed.
For example, I use that variables in my BAT
-files. Sample:
:: (c) Andrey Bushman, 2015
:: Building the .Net-extension for AutoCAD 2009(x86|x64), 2013(AnyCPU),
:: 2015(AnyCPU) with locating of some functional in the separate netmodule-file.
:: AutoCAD 2009x64
:: 1. module
start /WAIT "AutoCAD 2009x64" %net35%\csc @.\acad2009x64-netmodule.rsp .\Commands.cs .\ExtensionApplication.cs .\ExtensionMethods.cs
:: 2. assembly
start /WAIT "AutoCAD 2009x64" %net35%\csc @.\acad2009x64-entry-point.rsp /addmodule:".\\proxy.R17.2x64.netmodule" .\EntryPoint.cs
:: AutoCAD 2009x86
:: 1. module
start /WAIT "AutoCAD 2009x86" %net35%\csc @.\acad2009x86-netmodule.rsp .\Commands.cs .\ExtensionApplication.cs .\ExtensionMethods.cs
:: 2. assembly
start /WAIT "AutoCAD 2009x86" %net35%\csc @.\acad2009x86-entry-point.rsp /addmodule:".\\proxy.R17.2x86.netmodule" .\EntryPoint.cs
:: AutoCAD 2013
:: 1. module
start /WAIT "AutoCAD 2013" %net40%\csc @.\acad2013-netmodule.rsp .\Commands.cs .\ExtensionApplication.cs .\ExtensionMethods.cs
:: 2. assembly
start /WAIT "AutoCAD 2013" %net40%\csc @.\acad2013-entry-point.rsp /addmodule:".\\proxy.R19.0.netmodule" .\EntryPoint.cs
:: AutoCAD 2015
:: 1. module
start /WAIT "AutoCAD 2015" %net40%\csc @.\acad2015-netmodule.rsp .\Commands.cs .\ExtensionApplication.cs .\ExtensionMethods.cs
:: 2. assembly
start /WAIT "AutoCAD 2015" %net40%\csc @.\acad2015-entry-point.rsp /addmodule:".\\proxy.R20.0.netmodule" .\EntryPoint.cs
The same .Net Framework versions are installed on my machine in office. Also this computer has MS Visual Studio.2013 installed. In the IDE I see such list of enabled .Net Framework versions:
The .Net Framework 4.5, .Net Framework 4.5.1 items exist also...
My question: How can I set the target .Net Framework version (.Net 4.0, or .Net 4.5, or .Net 4.5.1) when I use the tools (csc.exe
) from the %NET40%
directory on my notebook manually, or in my BAT
-files? I don't see this option in the csc.exe /?
output.