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.

How to build on Linux?

See original GitHub issue

I thought I knew how to build dotnet stuff on Linux, but obviously not.

I’ve got Ubuntu 18.04 running in WSL.

I’ve got dotnet installed.

When I do:

dotnet restore
dotnet build

I get: image

I didn’t think you could actually install .NET 4.7.2 on linux. If you can, I don’t know how. Hence me asking here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vandycknickcommented, May 25, 2020

Ah ok, I wasn’t pointing fingers here only providing some context because I got interested. IMO I would also just use the last one, the others I included just as an FYI.

Anyways I just tried this out on my mac, don’t have a linux setup with mono and dotnet core atm (will wack up a docker container and test later today) and it works for me.

Adding those references only allows you to build a dll or exe targetting full framework on unix. You still need a full framework runtime like mono or .NET Framework to run the generated binary. The Example and Designer projects are full framework so you can’t use dotnet core to run those because doing so will give you the error you posted above.

Example:

mono Designer/bin/Debug/Designer.exe
1reaction
vandycknickcommented, May 25, 2020

You should be able to fix this by adding a reference to Microsoft.NETFramework.ReferenceAssemblies from nuget.

I ran into this exact same issue a while ago and there are a few ways to work around it one of which is just using the mono build tooling. But adding the full framework reference assemblies is the easiest one, I documented the others here: https://nvd.codes/post/dotnet-build-target-net4x-on-unix-systems.

Haven’t tested this with gui.cs yet though, will see if I have some time this evening to give it a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Build Linux Kernel {Step-By-Step}
Building Linux Kernel · Step 1: Download the Source Code · Step 2: Extract the Source Code · Step 3: Install Required Packages...
Read more >
Building and Installing Software Packages for Linux: Using ...
The Makefile is the key to the build process. In its simplest form, a Makefile is a script for compiling or building the...
Read more >
Steps to Build a Typical Linux Project
Choose a good maintained and scripted project to work with it. And then follow the below steps for building and deploying your project...
Read more >
Create Your Very Own Operating System With Linux From ...
Not everyone knows this, but you can create your own Linux-based operating system from scratch. Here's how to get started.
Read more >
Building Programs from Source on any Linux Distribution
In this video, I am going over building programs from source on any Linux distribution. Install the essentials $ sudo apt-get install ......
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