tryashtar / nbt-studio

An up-to-date NBT viewer and editor with lots of new features
521 stars 42 forks source link

Update to .NET 6 #45

Closed TetraTheta closed 1 year ago

TetraTheta commented 2 years ago

Since NBT Studio upgraded to .NET 5, it is mandatory to install .NET Runtime to use NBT Studio. (.NET Framework 4.8 is shipped with Windows 10/11)

But .NET doesn't have 'backward compatibility'. So even if you installed .NET 6 Runtime, you must install .NET 5 Runtime which is now marked as EOL to use NBT Studio. This makes me uncomfortable.

This is just suggestion. If you have some reason that makes you cannot update to .NET 6, it is ok.

tryashtar commented 2 years ago

Would you prefer downgrade to 4.8 or upgrade to 6? I didn't know 4.8 shipped with Windows; if it does and 6 doesn't it may be worth the trade

TetraTheta commented 2 years ago

I personally prefer run program 'without dependencies'.
before v1.15, NBT Studio already has .NET Framework as dependency, but since that .NET Framework is already shipped with Windows, I consider that as 'no dependencies'.

As official documentation of .NET Framework, future Windows will have .NET Framework 4.x too.

.NET Framework 4.8 is the last version of .NET Framework. .NET Framework is serviced monthly with security and reliability bug fixes. .NET Framework will continue to be included with Windows, with no plans to remove it.

There are few other projects I use that require latest .NET Runtime to be installed. So, I end up installing multiple version of .NET Runtime installed. That's why I posted this issue.

So, I'm ok with both downgrading to 4.8 or upgrading to latest version of .NET. But if you want me to pick one, I'd prefer downgrading to 4.8 if there is no breakage for downgrading.

Should I change the issue title for reflecting both changing .NET version to 4.8 or 6?

PS. The tradeoff of downgrading to 4.8 would be no multi-platform support. As far as I know, Above version of .NET Core 3 has multi-platform GUI support. So if you downgrade to .NET Framework 4.8, people using OS rather than Windows won't be able to run NBT Studio in their OS.

PPS. this article describes about the difference between .NET and .NET Framework.

RezaJooyandeh commented 1 year ago

The release could be single file containing all the dependencies: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#sample-project-file

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <PublishSingleFile>true</PublishSingleFile>
    <SelfContained>true</SelfContained>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishReadyToRun>true</PublishReadyToRun>
  </PropertyGroup>
</Project>
tryashtar commented 1 year ago

I've tried that, but it makes the file enormous

Ideally Microsoft would make installing the dependencies seamless but apparently they don't want to do that

RezaJooyandeh commented 1 year ago

I think it is expected for the file to grow if all the dependencies are bundled in a single file. You could either install the dependencies separately or bundle in a single file.

Zoranan commented 1 year ago

I was able to get this updated to .net6.0. Seems to be working fine, all tests passed. If anyone is still interested it's on my fork here.

TetraTheta commented 1 year ago

actually, this is already updated to .NET 6 according to the latest release

Zoranan commented 1 year ago

Oh, odd. When I cloned down the code all the projects were set to .NET 5 still, but I didn't check the releases