gui-cs / TerminalGuiDesigner

Forms Designer for Terminal.Gui (aka gui.cs)
MIT License
423 stars 28 forks source link

TerminalGuiDesigner cannot run on .net8.0. .net 7.0 required for dotnet tool #254

Closed dodexahedron closed 9 months ago

dodexahedron commented 9 months ago

Ubuntu 23.04, with dotnet-sdk-8.0 installed.

dotnet-sdk-7.0 and other 7.0 packages are not installed, because apt will not let them coexist.

TerminalGuiDesigner can be installed using the usual dotnet tool install TerminalGuiDesigner

However, attempting to run it gives the following result:

dotnet tool run TerminalGuiDesigner TestGui.cs
You must install or update .NET to run this application.

App: /home/myUserName/.nuget/packages/terminalguidesigner/1.0.25/tools/net7.0/any/TerminalGuiDesigner.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
.NET location: /usr/share/dotnet/

The following frameworks were found:
  8.0.0 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

It seems to have a hard requirement for version 7 and refuses to run under 8.\ On Windows, there's no problem having dotnet 7 and 8 installed at the same time, so it runs just fine on my Windows machines.\

Standard .net roll-forward rules for framework versions cannot cross major version boundaries.

This issue can likely be resolved by adding a net8.0 target for the tool.

dodexahedron commented 9 months ago

Note that the coexistence problem seems to be the fault of apt.

If one uses full aptitude to select the dotnet-sdk-7.0 package and its dependencies, it does not complain about conflicts and allows them to both be installed, and then, of course, the net7.0 tool will run.

dodexahedron commented 9 months ago

This isn't Ubuntu-specific, or even Linux-specific.

This will happen on any system that does not have 7 installed, but does have 8 installed, due to the roll-forward rules stopping at major version boundaries and tools being framework-dependent.

I've renamed the issue to reflect that.

255 adds .net8.0 targets, and it runs like a charm if built locally, but I'm not sure if that's an appropriate way for it to be handled, for the tool deployment.

256 is just a branch from #255 that also migrates to NUnit 4.0 and makes the necessary adjustments for the tests to work on the new version of NUnit.

If either or both of them aren't to anyone's liking, feel free to kick them to the curb.

I just wanted to use it on a .net8 machine and did the work anyway, so figured I'd share the fruits of my labor. :)

tznind commented 9 months ago

Please try: https://www.nuget.org/packages/TerminalGuiDesigner/1.1.0-rc1

Should be compatible with both 7.0 and 8.0 🤞

dodexahedron commented 9 months ago

Will do in a few minutes.

I was just about to fire up VS and convert some more unit tests, too, so I'll rebase on that and resolve whatever conflicts before I continue that work.

dodexahedron commented 9 months ago

Woo!

I purged .net 7 from the machine and tried with only 8 installed, and it works. 🥳

At first I was still having trouble, but then I realized I had also installed it as a local tool, where I was trying to use it. Ran the global tool and it worked. Updated the local tool and ran local and it worked as well.

So, all good on Ubuntu 23.04 with .net8.0.

tznind commented 9 months ago

Thanks for confirming. I will do a production release!