question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build the code for .NET 4.5 on Linux (mono)

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
alexvaluyskiycommented, Jan 6, 2017

Dnx and Dotnet CLI preview 2 supports Mono out-of-the box. I think this version of CLI should support it as well

0reactions
blackdwarfcommented, Jan 12, 2017

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build the code for .NET 4.5 on Linux (mono) #7438
Steps to reproduce I've created a project with two target frameworks: net45 and netstandard1.6 TestMonoProject net45;n...
Read more >
MonoDevelop Not Recognizing .NET 4.5 Support
I have built Mono and MonoDevelop from Github sources and it seems to have some .NET 4.5 support: enter image description here.
Read more >
Build .NET 4.5 on Linux in 5 minutes | by ⚡️Hudson M️endes
The sole objective of this article is to teach you How To Build .NET 4.5 Applications in a Linux Environment using Mono and...
Read more >
How to install Mono or dotNET45 on Linux - Tutorial
Tutorial showing how to install and configure Mono (dotNET) in Linux through WINE, including wine uninstaller & MSI package method, ...
Read more >
Install .NET on Linux without using a package manager
This article demonstrates how to install the .NET SDK or the .NET Runtime on Linux by using the install script or by extracting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found