Please provide
- Operating system: Windows 10
- Programming language you’re coding in: .NET
- Is connected mode used: SonarQube (Developer Edition)
After executing 2nd command to analyze the code as ‘MsBuild.exe /t:Rebuild’, the below .NET Framework version issue is coming. And also tried to install suggested framework version 4.5.1 also as 4.5 version is not available, but still it is showing same issue as below.
*Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the “-m” switch.
Build started 10/31/2022 9:47:02 AM.
Project “D:.… .sln” on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration “Debug|Any CPU”.
Project “D:… .sln” (1) is building “D:… .csproj” (2) on node 1 (Rebuild target(s)).
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersio n.targets(1221,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve th is, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can do wnload .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [D:… .csproj]
Done Building Project “D:…csproj” (Rebuild target(s)) – FAILED.
Done Building Project “D:… .sln” (Rebuild target(s)) – FAILED.
Build FAILED.
“D:… .sln” (R ebuild target) (1) →
“D:… .csproj” (Rebuild target) (2) →
(GetReferenceAssemblyPaths target) →
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVers ion.targets(1221,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [D:… .csproj] *
*0 Warning(s) *
1 Error(s)
Please help me out, to solve this issue.
Thanks,
Sushma