How to build on Linux?
See original GitHub issueI 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:
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:
- Created 3 years ago
- Comments:17 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
andDesigner
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:
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.