UPDATE:
Using "0.0 — Use the latest supported version on the target machine." seems to be working fine but it seems to be the default behaviour if the compiler can't find the specified version.
Again, will be much appreciated if someone can point out how the compiler finds .Net Framework version when I use "version_major.version_minor— Use a specific version of the framework." i.e. what setup needs to be done so that the compiler finds the version specified. (Environment variable etc.)
D:\CSharpBuildTest>"C:/Program Files/MATLAB/R2017b/bin/mcc.bat" -W "dotnet:Company.Team.Product,MyClass,0.0,Private,local" -T link:lib -d "bin\csharptest" -v "class{MyClass:Export\getConfigValue.m}"
Compiler version: 6.5 (R2017b)
Dependency analysis by REQUIREMENTS.
Parsing file "D:\CSharpBuildTest\Export\getConfigValue.m"
(Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "bin\csharptest\MyClassNative.cs".
Generating file "bin\csharptest\MyClass.cs".
Generating file "D:\CSharpBuildTest\bin\csharptest\readme.txt".
Executing command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /optimize /doc:"bin\csharptest\MyClass.xml" /t:library /r:"C:\Program Files\MATLAB\R2017b\toolbox\dotnetbuilder\bin\w
in64\v4.0\MWArray.dll" /resource:"bin\csharptest\MyClass.ctf" /out:"bin\csharptest\MyClass.dll" "bin\csharptest\MyClass.cs"
Executing command: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /optimize /doc:"bin\csharptest\MyClassNative.xml" /t:library /r:"C:\Program Files\MATLAB\R2017b\toolbox\dotnetbuilder
\bin\win64\v4.0\MWArray.dll" /resource:"bin\csharptest\MyClass.ctf" /out:"bin\csharptest\MyClassNative.dll" "bin\csharptest\MyClassNative.cs"
D:\CSharpBuildTest>

