XSharp builds on .Net Core

This forum is meant for questions and discussions about the X# language and tools
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

XSharp builds on .Net Core

Post by Chris »

Hi Wolfgang,

VS uses MSBuild to build projects, and without MSBuild you cannot do anything in VS, you cannot build even a simple standard .Net hello world app. XIDE does not use MSBuild, but you can still compile .Net programs. I do not see any reason for not being able to already write and compile .Net Core apps in XIDE, if you simply add references to the .Net Core dlls, instead of the standard .Net ones.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

XSharp builds on .Net Core

Post by wriedmann »

Hi Chris,
I will try that and let you know.
From what I have seen in Fabrices session a few years ago in Köln is is not that easy.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

XSharp builds on .Net Core

Post by robert »

Dick,
At this moment .Net Framework, .Net Core, Mono and Xamarin are 4 implementations of the same .Net standard that live "side by side". The codebase for these 4 implementations is different, but they use the same underlying technology. Some types and methods exist in one platform and not in another. .Net Framework 4.8 and .Net Core 3.0 will be the last versions of these side by side .Net implementations.

For the future Microsoft is merging the 4 frameworks into one (new) implementation, which is called .Net 5.
Of course there are still differences between platforms, a Web server running on Linux does not have a windows desktop UI, but the source code for running .Net on WIndows desktop and Linux will be the same.
So Microsoft will stop developing .Net Framework and .Net Core side by side.

With .Net 5 you can target Desktop, Cloud, Mobile etc, based on the same code. There is one codebase and no longer different teams working on the runtimes.
.Net 5 will live side by side with .Net 4.8. There will be no new development on .Net 4.8 anymore (most likely there will be bug fixes if for example security issues are found).

To answer your second question: converted VO app running in X# can run on Windows Desktops, since they require a desktop. I do not think that converted VO apps can/will run on Mobile or Linux.
Apps that use Windows.Forms for their UI may also run on Linux if there is an implementation of Windows Forms for Linux. I am not sure about that.
Apps with just a Console UI or services can run on any platform.

Robert

EDIT:
I should have probably named this thread: XSharp builds on .Net 5. The reason that I have chosen .Net Core is that with the same tooling I can also build for .Net Core 3 by choosing a different framework name in the MsBuild project file.
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

XSharp builds on .Net Core

Post by Chris »

Hi Wolfgang,
wriedmann wrote:Hi Chris,
I will try that and let you know.
From what I have seen in Fabrices session a few years ago in Köln is is not that easy.
Wolfgang
Maybe Fabrice was using VS?

;)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

XSharp builds on .Net Core

Post by wriedmann »

Hi Chris,
maybe Fabrice was using VS, but I'm not sure.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

XSharp builds on .Net Core

Post by Chris »

I was just kidding Wolfgang, of course Fabrice was using VS. I think that same with the compact framework, the only complexity is making VS actually support different environments through MSBuild. I do not expect there will be any issues compiling .Net Core apps in XIDE out of the box, just haven't tried it myself yet, just waiting for .Net Core to become a bit more mature first. But if you do try it, please let me know of your results!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

XSharp builds on .Net Core

Post by wriedmann »

Hi Chris,
for sure I will let you know! (if I succeed ever - I have my doubts....)
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

XSharp builds on .Net Core

Post by ic2 »

Hello Robert,

Thanks for the explanation. It's certainly an achievement that you could compile a (basic) X# program for .Net Core and run it on Linux.

About the new .Net5 Core: it was about time that Microsoft stopped doing the same thing in 4 different incompatible ways. But I am afraid it will be too late. We have seen that with the UWP apps which have been far from successful and are now slowly being abandoned.

I have once published a C# program in the Windows Store using the Desktop Bridge but the whole program procedure was full of bugs and it took me days to convert it and this time I had the support of an Italian Microsoft guy who was very helpful. Probably I was one of the first users of this Desktop Bridge App :unsure: . In the end not worth the time and effort.

I am almost sure that any conversion to .Net Core is the same painstaking procedure. Which mean that the vast majority of the programs remain Windows Desktop programs in a .Net Framework versions which is no longer maintained. That is: if Framework programs require conversion to .Net 5 which I have not seen confirmed or denied yet.

Then, after 2 or 3 years, Microsoft decides to abandon the idea again of having 1 .Net version and will start working again on new .Net Framework update.

Just see Microsoft's history for that, WPF would take over Winforms and didn't, UWP would take over Desktop and it didn't, programs like OneNote Desktop would not receive further updates because there was a UWP app and then OneNote Desktop was suddenly revived again.

Who knows they reintroduce the Windows Phone, running .Net Framework 4.9 Desktop programs. :silly:

(Although I am clearly not a fan of Microsoft, the whole Windows Phone system was much nicer than Android).

Dick
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

XSharp builds on .Net Core

Post by robert »

Dick,

This does not just work for Console Apps. I also have a Windows Forms app running with .Net 5 now.

W.r.t. the "4 different things": Mono and Xamarin were developed by outside companies.
Microsoft has acquired Xamarin and if I am correctly informed has hired the people behind Mono.
They then started to work on .Net Core with the long term goal to make .Net Core so complete that it could replace .Net Framework. I think you can call .Net Core 2 and 3 "beta versions" of the new .Net 5, but I think Microsoft will never admit that.
Now the moment has arrived that the new .Net 5 can replace all 4 predecessors.
And I doubt that the conversion to .Net 5 will be painful. If it is then most people will not do it.
This morning I have tried to see if I could compile XSharp.Core and XSharp.RT with .Net 5, and that was relatively easy.

For XSharp.Core I got 2 compiler errors:
- we have code that reads the OS() version from the registry. I needed to add a package reference to Microsoft.Win32.Registry
- we are using a method String.Copy() which generates a warning that this method is now obsolete (see https://github.com/dotnet/runtime/issues/27515)

XSharp.RT has a similar problem and also has a reference to System.Windows.Forms, which means that I need to set the Sdk value in the project to Microsoft.NET.Sdk.WindowsDesktop in stead of Microsoft.NET.Sdk
Of course that means that that part of XSharp.RT will only work on Windows, but the code that does this contains a check to see if the app is running on windows.
In the coming weeks I'll compile all the XSharp runtime DLLs with .Net 5 to make sure we are not using code that will not work on the next .Net.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

XSharp builds on .Net Core

Post by ic2 »

Hello Robert,
robert wrote:Dick,

And I doubt that the conversion to .Net 5 will be painful. If it is then most people will not do it.
I hope you are right, and you may be given your own experiences.

I have one more question. Suppose I target .Net Core (or later .Net5 ) for a current .Net Framework 4x application. Does that potentially prevent it from working on some Pc's? Or said otherwise: my own Pc is on W10 1903 and I apply security patches only every few months. This has apparently installed .NetCore 3.1.301 and .NetFramework 4.8.03752.

Would you expect installation with a recent .Net Framework but with an old .NetCore so .NetCore program's won't work? Or are Core & Framework installed together (so both are an older version or both are recent)?

PS: to check .Net Framework enter this in a DOS prompt:

Reg query "HKLMSOFTWAREMicrosoftNet Framework SetupNDP" /s
The entry Version REG_SZ 4.8.03752 shows that you have 4.8.

(I just saw I can't type 4 dot 8 with a ) because it makes a emoticon from it)....

and this for .Net Core:

dotnet --list-sdks

3.1.301 [C:Program Filesdotnetsdk] shows that you have Core 3.1)

Dick
Post Reply