0
votes

When trying to build a C# code with:

 "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" project.sln
 "C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe" project.sln

I get:

C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1098,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

Then I installed ndp48-devpack-enu.exe coming from https://dotnet.microsoft.com/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer (".NET Framework 4.8 Developer Pack") but the result is the same.

Note:

  • The installation of ".NET Framework 4.8 Developer Pack" did not seem to install its own msbuild and csc.exe. Is this normal or am I missing something? That's why I used C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe that had been installed previously when installing Microsoft Visual C++ Build Tools.

  • I'd like to install only the minimum to build C# projects from command-line, I don't want to install Vistual Studio IDE, etc.

1

1 Answers

0
votes

You should install .Net SDK 4.5

Newer version don't support older targets