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

Migrate to dotnet core 3.1 #28

Closed

Conversation

JackRhodes
Copy link

@JackRhodes JackRhodes commented Feb 8, 2020

This PR migrates to .NET Core 3.1

@gabrielefilipp
Copy link
Owner

Hey I'm pretty noob with that stuff. What does it change?

@JackRhodes
Copy link
Author

JackRhodes commented Feb 9, 2020

This PR migrates the runtime over to .NET Core 3.1 instead of using .NET Framework 4.6.1. The major benefit is that .NET Core has a few new language features, and is the direction Microsoft is pushing for in modern apps.

My main reason for doing this is that I think the current release and auto update process is a bit overly complicated so I wanted to look to simplify it a bit in some upcoming PRs.

Here's an idea for a simpler release process that I could implement after this change:

  1. On merge to master, a github action is triggered that builds a single self-contained exe (so you don't have to include newtonsoft when you download)
  2. This exe is then included as part of a github release, so people can then download then new exe from the release tab rather than having to navigate to the bin folder
  3. Auto updater code is simplified a bit to look at the latest github release rather than having to compare it to the version in the bin file

This PR is a bit "out there" so if we don't want it then that's fine 👍

@sir-wilhelm
Copy link

@JackRhodes I ended up implementing an updater that uses .NET 4.6.1 and github releases. feel free to take a peek at sir-wilhelm#5 for the changes.

I think it's cleaner than the current implementation, but does rely on versioning the project and tagging/creating a release in github.

I've not had a chance to play with publishing a self contained .netcore version yet. It might not be that bad since MHW only runs on 64bit windows machines, but it would really just be a fun thing to try.

I don't see .net core happening until it can bundle the app into a self contained .exe, and behaves like the .net framework exe.

@JackRhodes
Copy link
Author

@sir-wilhelm Just took a look, and that approach looks much better 👍 .

I don't see .net core happening until it can bundle the app into a self contained .exe, and behaves like the .net framework exe.

👆 this is definitely possible. I think I may just expand the scope of this PR to include that, else changing the dependency and not bundling the runtime will just confuse consumers of the app. I'll spend some time over the weekend doing so 👍

@JackRhodes JackRhodes force-pushed the feature/MigrateToDotNetCore branch from 0db8435 to 654db89 Compare February 15, 2020 11:06
@JackRhodes JackRhodes force-pushed the feature/MigrateToDotNetCore branch from 44bcb2b to b4d8478 Compare February 15, 2020 12:56

settings.Converters.Add(new StringEnumConverter());
settings.Converters.Add(new StringFloatConverter());

var jsonString = JsonConvert.SerializeObject(Values, settings);

File.WriteAllText(FullPathFileName, jsonString);
using (var fileStream = new FileStream(FileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Write, 4096, FileOptions.None))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue here is that it fails to resolve the file stream correctly. So we need to explicitly grab it rather than relying on File.WriteAllText to auto resolve it for us

@JackRhodes
Copy link
Author

JackRhodes commented Feb 15, 2020

Ok I've been playing around with this locally, and have pushed the minimum changes needed to get .NET Core working while compiling to a single .exe with the framework bundled with it, and keeping all of the existing config files in the directory

I've also added a simple github action that builds it (it's basically the default one that github gives you)

(Screenshot of it working)
image

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

Successfully merging this pull request may close these issues.

3 participants