MSBuild issue on Linux

Answered

Hi,

I have a project I'm trying to build on Linux.  I can successfully build this from the command line using "dotnet build" however the build fails in Rider with the following:

"Microsoft.Common.CurrentVersion.targets(1122, 5): [MSB3644] The reference assemblies for framework ".NETFramework,Version=v4.0" 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." 

I have run both "dotnet build" and the Rider build with diags and the difference seems to be to do with the resolution of reference assembly paths.

In Rider the debug logs have the following which causes the failure:

Target "GetFrameworkPaths" in file "/usr/share/dotnet/sdk/2.0.2/Microsoft.NETFramework.CurrentVersion.targets":
Done building target "GetFrameworkPaths" in project "TopicSubscriber.csproj".
Target "GetReferenceAssemblyPaths" in file "/usr/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets":
Using "GetReferenceAssemblyPaths" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "GetReferenceAssemblyPaths"
/usr/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" 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.
Done executing task "GetReferenceAssemblyPaths" -- FAILED.

However, the "dotnet build" logs show it is skipping resolution: 

2>Target "GetFrameworkPaths" in file "/usr/share/dotnet/sdk/2.0.2/Microsoft.NETFramework.CurrentVersion.targets" from project "/home/jondiamond/Dropbox/workspace/solace/solace-samples-dotnet/src/TopicSubscriber/TopicSubscriber.csproj" (target "PrepareForBuild" depends on it):
2>Done building target "GetFrameworkPaths" in project "TopicSubscriber.csproj".
2>Target "GetReferenceAssemblyPaths" in file "/usr/share/dotnet/sdk/2.0.2/Microsoft.Common.CurrentVersion.targets" from project "/home/jondiamond/Dropbox/workspace/solace/solace-samples-dotnet/src/TopicSubscriber/TopicSubscriber.csproj" (target "PrepareForBuild" depends on it):
Task "GetReferenceAssemblyPaths" skipped, due to false condition; ('$(TargetFrameworkMoniker)' != '' and ('$(_TargetFrameworkDirectories)' == '' or '$(_FullFrameworkReferenceAssemblyPaths)' == '')) was evaluated as ('.NETFramework,Version=v4.0' != '' and ('/usr/lib/mono/4.5' == '' or '/usr/lib/mono/4.5' == '')).
2>Done building target "GetReferenceAssemblyPaths" in project "TopicSubscriber.csproj".

 

Any ideas? 

 

In the build settings the TargetFramework is ".NETFramework,Version=v4.0'" it's the only entry in the list and I don't seem to be able to change it. MSbuild tool version is the same in each. 

 

Thanks

 

Jon

1 comment
Comment actions Permalink

I am getting the same kind of issue on both Fedora 27 and Ubuntu 17.10 on brand new installations with the correct prereqs.  I have an issue opened about it here: https://youtrack.jetbrains.com/issue/RIDER-12005

0

Please sign in to leave a comment.