Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mono version complains about missing .NET 4.7 targeting packs #45257

Closed
nonunknown opened this issue Jan 17, 2021 · 6 comments
Closed

Mono version complains about missing .NET 4.7 targeting packs #45257

nonunknown opened this issue Jan 17, 2021 · 6 comments

Comments

@nonunknown
Copy link
Contributor

Godot version:
Godot 3.2.4 beta 6 Mono

OS/device including version:
Ubuntu 20.10

Issue description:
When the user installs mono (all features), he also needs to install .Net 5.0 (or else he gets errors when compiling)

Workaround
change targetframework to net5.0
image

Steps to reproduce:

  • Get a Fresh Ubuntu 20.10
  • Install godot version mentioned above
  • install mono with all features
  • Create a new godot project
  • Create a new script .cs
  • Press F6 an run

At this moment your project will run without any errors, but if you look at MSBuild tab notice he will complain about missing 4.7

Workaround:

  • Install .Net 5.0
  • in the ".csproj" file change targetFramework to net5.0
  • Compile again and now project works well

Minimal reproduction project:
A Empty project already satisfies

@Calinou Calinou changed the title [Linux] Mono Requires .NET 4.7 instead of .NET 5.0 Mono Requires .NET 4.7 instead of .NET 5.0 Jan 17, 2021
@aaronfranke aaronfranke changed the title Mono Requires .NET 4.7 instead of .NET 5.0 Mono version complains about missing .NET 4.7 targeting packs Jan 17, 2021
@aaronfranke
Copy link
Member

aaronfranke commented Jan 17, 2021

Changed the title to reflect the actual bug. .NET 5 is not supported as a target yet. You can, however, use the build tools from .NET Core or .NET 5 (as of 3.2.4, see also #43717) to build Mono. Targeting net472 is the default and recommended option right now.

@nonunknown
Copy link
Contributor Author

Well, we have a problem then, because installing mono only (without .NET 5.0) will not meet godot requirements, because it will complain about the 4.7 and how to install 4.7 on linux?

@aaronfranke
Copy link
Member

@nonunknown I can't reproduce the issue. An empty project builds and runs just fine without any errors or warnings anywhere.

Screenshot from 2021-01-17 13-40-19

I'm on Ubuntu 20.04 with Mono 6.12.0.107 and .NET Core 3.1.405. It works with either build tool selected:

Screenshot from 2021-01-17 13-43-19

<Project Sdk="Godot.NET.Sdk/3.2.4">
  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <RootNamespace>Empty</RootNamespace>
  </PropertyGroup>
</Project>

45257.zip

Please provide more information (Mono and .NET versions), please test if the above project and if the official demo projects work on your system, and please make sure you have everything in this article set up.

@nonunknown
Copy link
Contributor Author

nonunknown commented Jan 18, 2021

I think this topic can be closed, for future users:

  • Uninstall mono and .net5.0 (in case you have)
  • install .netcore3.1 with the following command:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list 
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.1.4
sudo apt-get install dotnet-sdk-3.1
  • Restart your pc, and try a new godot mono project

PS: without changing .csproj to <TargetFramework>netcoreapp3.1</TargetFramework> it only works for building but doesnt work for autocompletion in vscode, so the user needs to change from net472 to netcoreapp3.1

@Moon422
Copy link

Moon422 commented Sep 22, 2021

I'm on Ubuntu 20.04 with Mono 6.12.0.107 and .NET Core 3.1.405. It works with either build tool selected:

That means I don't need to have Mono installed on my pc. I am using Linux mint. I am facing an issue with VSCode's C# extension when I use Mono build, as the recent C# extension need a higher msbuild version than what Mono's msbuild offers. Therefore, I switched to dotnet cli (I have dotnet 5 installed) and building of games without a problem and the also the C# extension for VSCode do not complain and the features are working. So, I want to ask if I stick dotnet cli for my future projects, am I going to face any issues?

@aaronfranke
Copy link
Member

@Moon422 No, you will not run into issues. The recommended option right now is to have .NET Core 3.1 SDK installed and optionally Mono, and use dotnet CLI as the build tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants