Closed akarnokd closed 4 months ago
Shouldn't this be reported to .NET as a regression?
Alright, let's the :point_right: :point_left: begin.
@akarnokd I ran into this issue earlier today and resolved it by installing .NET 6 and uninstalling .NET 8 via Windows "Apps & Features" Visual Studio Modify Installation button, which allows you to uncheck .NET 8 to uninstall it via the Visual Studio Installer. Once this is uninstalled, you will see .NET 6 when running dotnet --version
. Once that is done, use the dotnet new
CLI to create from the template like usual. You may need to restart your computer / Visual Studio.
@patrickdundas I already had the workaround and wasn't looking for one. The issue at hand is why it broke with .NET 8 and if it's the template's fault or .NET 8's. Apparently, it's a bug with .NET 8.
In the meantime while .NET 8 can't be used to make the project. Here's the workaround I used that does not involve deleting .NET 8:
run dotnet --list-sdks
Here's what mine looked like:
6.0.417 [C:\Program Files\dotnet\sdk]
7.0.304 [C:\Program Files\dotnet\sdk]
7.0.400 [C:\Program Files\dotnet\sdk]
8.0.100-preview.7.23376.3 [C:\Program Files\dotnet\sdk]
make this file and call it global.json
in your current directory:
{
"sdk": {
"version": "<dotnet 6 or 7 version>"
}
}
mine looked like this:
{
"sdk": {
"version": "7.0.400"
}
}
then run the dotnet new
as you would otherwise.
Hope this helps anyone
Instructions unclear.
- make this file and call it global.json in your current directory:
what is current directory? directory where i try to create my mod? shouldnt global.json be somewhere in dotnet directory?
- then run the dotnet new as you would otherwise.
You mean these commands from bepinex guide?
dotnet new bep6plugin_unity_mono -n MyFirstPlugin -T <TFM> -U <Unity>
dotnet restore MyFirstPlugin
Instructions unclear.
- make this file and call it global.json in your current directory:
what is current directory? directory where i try to create my mod? shouldnt global.json be somewhere in dotnet directory?
- then run the dotnet new as you would otherwise.
You mean these commands from bepinex guide?
dotnet new bep6plugin_unity_mono -n MyFirstPlugin -T <TFM> -U <Unity>
dotnet restore MyFirstPlugin
I found a document about global.json
update: sorry I think I pasted a link in this comment before I submitted it...but I couldn't find that link now...
If I remember correctly, that document says dotnet
will search for global.json
in a hierarchical way up to the root of current driver. For example, if you run dotnet
under C:\a\b\c\
, the searching of global.json
will be done in the following order:
C:\a\b\c\global.json
C:\a\b\global.json
C:\a\global.json
C:\global.json
Instructions unclear.
- make this file and call it global.json in your current directory:
what is current directory? directory where i try to create my mod? shouldnt global.json be somewhere in dotnet directory?
- then run the dotnet new as you would otherwise.
You mean these commands from bepinex guide?
dotnet new bep6plugin_unity_mono -n MyFirstPlugin -T <TFM> -U <Unity>
dotnet restore MyFirstPlugin
"current directory" meant wherever you planned on running dotnet new. so you could call that the root of your project folder
and yes i do mean that command.
for anyone coming upon this issue the simplest method is using the global.json file.
and unless there is a way to set it via some kind of environment variable or the like you must create it in the same directory you wish to store the project.
What that means is you want the file in the directory you are going to run a command like dotnet new bepinex5plugin -n OuterWildsTest
if you put the file in the correct location the command above will succeed and the resulting directory will look like
OuterWildsTest
global.json
Was this resolved by merging #12?
Was this resolved by merging #12?
Yes, @ManlyMarco, but apparently the dotnet build
fails with .net8.
That sounds like a different issue, closing this as resolved then.
With .NET 8 out, the usual way of using the template results in a not too detailed error message.
Can you look into the compatibility issue?
Issue
Yes, the template (1.4) is installed:
Workaround
dotnet new globaljson --sdk-version 7.0.404