Building effect file fails because of wrong .NET Core version

Using the MGCB Editor I am not able to build effects / shaders.

Build started 6/27/2021 9:51:04 AM

/home/ea/testproject/Content/effect.fx
/home/ea/testproject/Content/effect.fx: It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
  - The following frameworks were found:
      5.0.6 at [C:\windows\system32\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=win7-x64

I think I messed something up maybe. What do I have to check to find the issue? Which .NET Core version do I need? Where is defined what the MGCB Editor will try to use to build the content? Or is the MGCB Command Line Tool not up to date maybe?

This message seems to come from the wine installation under Linux. Do I need to install .NET Core 3.1 inside the “.Monogame” wine bottle / folder? Or should I update something else so that the shader / effect compilation will work under wine?

I don’t know if this is what has fixed it but I just installed / extracted .NET Core 3.1 into the wine bottle (~/.monogame folder). I did select merge all folders and to NOT replace files in the process. So basically I tried to add missing / required files. I am not sure if this was the issue but today effect compilation worked. I just thought to leave at least this info here.

2 Likes

Went through this again and seems to be the issue. This should get fixed in the official MonoGame script used in the docs.

After everything done for the installation for Ubuntu 20.04 it did not work. Only after I ran this script which should extract the needed dependencies for mgcb-editor effect compilation (dotnet core 3.1). Just skip all files (type “s” and hit return / enter) when the script asks how to proceed for files that already exist inside the ~/.winemonogame prefix because dotnet core 5 should be there already.

I am on LM 20.2 Uma which is distro which is based on Ubuntu 20.04 and if I see it right, this should not make a difference here)

#!/bin/bash

# check dependencies
if ! type "wine64" > /dev/null 2>&1
then
    echo "wine64 not found"
    exit 1
fi

if ! type "7z" > /dev/null 2>&1
then
    echo "7z not found"
    exit 1
fi

# init wine stuff
export WINEARCH=win64
export WINEPREFIX=$HOME/.winemonogame
wine64 wineboot

TEMP_DIR="${TMPDIR:-/tmp}"
SCRIPT_DIR="$TEMP_DIR/winemg2"
mkdir -p "$SCRIPT_DIR"

# get dotnet
DOTNET_URL="https://download.visualstudio.microsoft.com/download/pr/adeab8b1-1c44-41b2-b12a-156442f307e9/65ebf805366410c63edeb06e53959383/dotnet-sdk-3.1.201-win-x64.zip"
curl $DOTNET_URL --output "$SCRIPT_DIR/dotnet-sdk.zip"
7z x "$SCRIPT_DIR/dotnet-sdk.zip" -o"$WINEPREFIX/drive_c/windows/system32/"

Run the script at your own risk. If you want you can also do it by hand. Just download this file

https://download.visualstudio.microsoft.com/download/pr/adeab8b1-1c44-41b2-b12a-156442f307e9/65ebf805366410c63edeb06e53959383/dotnet-sdk-3.1.201-win-x64.zip

and extract it manually to:

~/.winemonogame/drive_c/windows/system32/

Important: Do NOT replace / override files which already exist!

It may be necessary to run the

mgcb-editor --register

command afterwards. After that I could choose mgcb-editor as default application to open files with the mgcb file extension (*.mgcb).

1 Like

Ran out of free time yesterday. Forgot to mention that I tried to fix the issue by installing dotnet core sdk 3.1 LM 20.2 Uma / to the OS itself (not the wine prefix) first. That did change the error message I got from the command line from (I think it was) error code 15 to error code 1 from the content builder target after running the “dotnet run” command from inside the openGL folder with the projects *.csproj file.

So there might be two issues which are resolved by installing dotnet core 3.1 sdk on the OS on the one hand and also on the other hand running the script / extracting the dotnet sdk 3.1 file from above to the wine prefix.

Difficult to find out for me now without guessing. Testing would be better here. So if anybody has free time to test a bit, please do and share your results :slight_smile: