Can't build the code for .NET 4.5 on Linux (mono)
See original GitHub issueSteps to reproduce
I’ve created a project with two target frameworks: net45 and netstandard1.6
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>TestMonoProject</AssemblyTitle>
<TargetFrameworks>net45;netstandard1.6</TargetFrameworks>
<AssemblyName>TestMonoProject</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="NETStandard.Library" Version="1.6.1" />
</ItemGroup>
</Project>
Expected behavior
I can build the project for both targets
Actual behavior
It fails on building for net45 with this error
/usr/share/dotnet/sdk/1.0.0-preview4-004233/Microsoft.Common.CurrentVersion.targets(1107,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. [/home/ravenger/TestMonoProject/TestMonoProject.csproj]
Environment data
.NET Command Line Tools (1.0.0-preview4-004233)
Product Information: Version: 1.0.0-preview4-004233 Commit SHA-1 hash: 8cec61c6f7
Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64 Base Path: /usr/share/dotnet/sdk/1.0.0-preview4-004233
Mono data
Mono JIT compiler version 4.6.2 (Stable 4.6.2.7/08fd525 Mon Nov 21 12:08:40 UTC 2016) Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Dnx and Dotnet CLI preview 2 supports Mono out-of-the box. I think this version of CLI should support it as well
As @livarcocc mentioned, the right place for this issue is the SDK repo and potentially the MSBuild repo. The dotnet/sdk#335 issue already tracks this and @borgdylan mentioned on that issue that he opened another one on MSBuild. With all of that, I will close this issue and let the discussion continue on the SDK issue.
if you feel this is an error, please reopen. Thanks!