Unable to execute static code analysis of project created in C# .Net Framework 4.6 on linux platform
Next error prompt:
dotnet build
MSBuild version 17.7.3+8ec440e68 for .NET
Determining projects to restore…
Nothing to do. None of the projects specified contain packages to restore.`
/usr/share/dotnet/sdk/7.0.402/Microsoft.Common.CurrentVersion.targets(1241,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6 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 .NET SDKs downloads for Visual Studio [/opt/atlassian/pipelines/agent/build/myproj.csproj]
On the sonarqube server machine (EC2 aws instance) the C# plugin is installed:
sonar-csharp-plugin-9.8.0.76515.jar
.NET 4.6 is Windows-only – so you won’t be able to build it on a Linux platform, which is a prerequisite for being able to analyze it with SonarQube (building it, not specifically with Linux).
I have .NET framework 4.6 solution that passes build without errors and could be run !
SonarQube definition is that it is capable to make analysis with C# code, right?
I think there should not be any limitation with it over bitbucket source control, isn’t it?
If we have any limitation so I would be appreciated you will list it please !
There are the errors in my first post in our conversation, about target framework missing:
/usr/share/dotnet/sdk/7.0.402/Microsoft.Common.CurrentVersion.targets(1241,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.6 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 .NET SDKs downloads for Visual Studio [/opt/atlassian/pipelines/agent/build/myproj.csproj]
but be aware that these are exclusively windows container instances and the do not understand apk-get install and probably will need the MSBuild approach in Colin’s link
tricking around with mono on custom images or https://hub.docker.com/_/mono/ may be an option