Longship icon indicating copy to clipboard operation
Longship copied to clipboard

[Question] Why stay on .NET 4?

Open Hi-ImKyle opened this issue 3 years ago • 10 comments

Title, you can and probably should update to either 4.7.2 or 4.8. BepInEx will load it either way? If it stays on 4.0 then that's fine, just removes my idea for creating a pull request for something.

Hi-ImKyle avatar Feb 23 '21 23:02 Hi-ImKyle

It's just because I cannot guarantee that it will work correctly, because Unity seems to be stuck with v4.0 framework.

AlexMog avatar Feb 23 '21 23:02 AlexMog

I built and ran Longship with .NET 4.8 just fine. Might be something to look into if you're so concerned about updating the framework. I've never seen any issues that happen in the past with modding other games with BepInEx.

Also if you saw me try and push to the main repo, my bad, still getting used to git commands :+1:

Hi-ImKyle avatar Feb 23 '21 23:02 Hi-ImKyle

I'll try then :) Don't worry, you can't push directly on a repo that is not yours, you need to make a PR for that :)

AlexMog avatar Feb 23 '21 23:02 AlexMog

I know, I just don't know if you get notifications for it saying I tried or something. I created a Reflection branch on my fork, which gives you a class with more accessibility over reflection, 4.8 is required for it. If you want it I can create a pull request for it.

Hi-ImKyle avatar Feb 23 '21 23:02 Hi-ImKyle

Don't hesitate to create a PR if you think it could be a good addition to Longship :) if it's not too specialized and can help other developers (as Longship is primarly a high level API), it's always something great to have !

AlexMog avatar Feb 23 '21 23:02 AlexMog

I'll keep it on my repo for now, just till Longship gets more updates and if I feel Longship will be better off with it I'll create the pull. But I still recommend updating to a somewhat newer framework, doesn't need to be the latest! This is going very good so far I have to say.

Hi-ImKyle avatar Feb 23 '21 23:02 Hi-ImKyle

I'll do it then :)

AlexMog avatar Feb 23 '21 23:02 AlexMog

Mono support only up to 4.7 features, and even this not in full // i was wrong, mono 6.6.0+ and unity 2020.2 support almost all c#8 features (information about it is a mess). But we have 2019.4, so, probably no luck

kohanis avatar Mar 02 '21 19:03 kohanis

I built and ran Longship with .NET 4.8 just fine

Hi-ImKyle avatar Mar 02 '21 19:03 Hi-ImKyle

Yeah, as I said, it works particularly, but then you will need to indicate in readme about not-working features of 4.8 in mono+current unity(which aren't clearly listed anywhere) and c#8 in .net framework Btw, harmony already have a huge part of this helpers in utilities like foo.GetType().GetFieldFull("bar") => AccessTools.Field(foo.GetType(), "bar") and SetFieldValue(foo, "myField", "bar") => Traverse.Create(foo).Property("myField").SetValue("bar") Although AccessTools doesn't use cache. Traverse uses

// I never said it was a bad idea, just need some information in the readme, then

kohanis avatar Mar 04 '21 05:03 kohanis