radimitrov / CSharpShellApp

85 stars 18 forks source link

Porting the app to .NET 7 #218

Closed radimitrov closed 1 month ago

radimitrov commented 1 year ago

Next week I will start porting the app to .NET 7 from the current Xamarin.Android project. There are a few changes that will happen. This process will take at least a few weeks. Here is a list of the changes that will happen.

  1. The app will support newer libraries due to the .NET 7 BCL. Also some performance boosts from that.
  2. Xamarin.Forms will be replaced with .NET MAUI. I will implement a basic migrator.
  3. ASP.NET Core 2.2 will be removed but ASP.NET Core 7.0 won't be included. Keeping the 2.2 version isn't possible. I can't figure out how to get it running under Android. Might actually not be possible since Microsoft don't intend to support that. So at least for now the app will continue without it. I've attached a basic project that simulates the issue in case anyone has any ideas. AndroidSimulatedWebApplication.zip
1ffycat commented 1 year ago

That's really great, have been waiting for this for quite a while. By the way, is there any possibility you would add support for global usings? For now, adding global usings results in an error CS8915

firstygoldfish commented 1 year ago

I understand the need for progress and this is a great step forward but can Xamarin.Forms co-exist alongside MAUI and be included for backwards compatibility?

Great app and quite impressed with Xamarin Forms now its going to be replaced :)

radimitrov commented 1 year ago

@1ffycat That's an app bug. I can probably fix it tomorrow.

@firstygoldfish MAUI.NET is practically the next Xamarin.Forms with changed namespaces and a few improvements. Despite that, I don't think Xamarin.Forms will work under an .NET 6 Android app. Even if it does I expect major conflicts if both are added to the project.

firstygoldfish commented 1 year ago

I understand its the replacement but it would be nice to be able to support both. It would be easier if I could have the old version and new version installed at the same time. Thanks again for the speedy response. All good feedback.

radimitrov commented 1 year ago

@firstygoldfish Yes, I do intend to copy and modify the last build as an archive package and upload it in the Google Drive folder with a different package name.

jgranserver commented 1 year ago

Yes thats nice to see. By the way, about the reference assembly that are being referred by default example. System.Runtime. is there a way to remove it? coz it conflicts with the nuget package im including in the project, thus it wont export the assembly because of that error.

radimitrov commented 1 year ago

No. System.Runtime isn't explicitly referenced by default. It is a dependency. However if you could that wouldn't matter. Even if you reference another System.Runtime package the Mono runtime will still use the one already inside the app.

jgranserver commented 1 year ago

[Error] CS1705: Assembly 'TShockAPI' with identity 'TShockAPI, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

they have the same public token but it will still have this kind of error.

radimitrov commented 1 year ago

@jgranserver This package? It only supports .NET 6.0.

jgranserver commented 1 year ago

oh okay. will this be supported when the app ported to .NET 6?

radimitrov commented 1 year ago

@jgranserver Yes, it should be.

jgranserver commented 1 year ago

does the update now supports .NET6?

radimitrov commented 1 year ago

@jgranserver No. I've just started porting it. It will take a while. Last update was just a hotfix. The .NET update will be app version 3.0. And it should say something like ".NET 7" in the main menu, if I remember correctly

BanDroid commented 1 year ago

Please add some demo/examples on working with xml/xaml file in Xamarin.Android project, it frustrating to make layouts programmatically

radimitrov commented 1 year ago

@BanDroid Doesn't have much to do with .NET versions, except how it will always work under Android. The app may always be limited in regards to Android resources and C# <-> Java. Best I could do for now is add this (haven't tested it yet).

BanDroid commented 1 year ago

@BanDroid Doesn't have much to do with .NET versions, except how it will always work under Android. The app may always be limited in regards to Android resources and C# <-> Java. Best I could do for now is add this (haven't tested it yet).

I know 😅 i commented here just so you know. Inflating layout at runtime is good too, but the view could be from material design, is it possible?

radimitrov commented 1 year ago

It should be.

radimitrov commented 1 year ago

Well, this took longer than expected (porting bug), but I'm nearly done. Aside from a few minor things all that is left is some of the MAUI support. Might be ready January but the first week of February is more likely. A short list of changes:

radimitrov commented 1 year ago

At least a week later than expected, however it is now ready. The update has been released and should be available soon.

Currently there are just 4 editor themes and they seem to basically be 90% operational in regards to syntax highlighting for now. Today I'm updating the Google Play build, the Huawei and custom ones will come next week

Good news, an old feature is back in the Google Play version of the app - exporting APK. Still no one-click install since Google policies forbid it in such a context, however that is what file manager apps are for.

Now the bad news. It appears Visual Studio has more issues with desugaring. I will have to investegate a bit. However this means that for now the update is for devices with Android >= 7.0.