4

I was looking for possibilities for porting some web projects from Windows .NET framework to Ubuntu linux using open source .NET core

After a lot of struggle with Mono, which I have almost gave up. I was looking at .NET core as a new hope. Have anyone of us ported from .NET to .NET core?

If yes, can the possible problems like the ones I faced with Mono be shared?

Community
  • 1
  • 1
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219
  • 1
    .net core is not really usable now, this quarter will be released the first RTM version, but it will lack tons of functionalities. I use myself mono everyday for work, the latest versions are really very stable and ready for production. Maybe you tried old versions of mono? Try to compile the latest version from Github, you will have a good surprise. In my case I just program in Windows/VS2013 and then execute my code on Linux/Mono, it woks flawles (my prograqms are or console programs or services, UI is another history, but .NET core doesn't even have UI projects) – Gusman Jan 06 '16 at 19:23
  • @Gusman That's great to hear! But [Miguel](https://twitter.com/migueldeicaza) himself [doesn't seems to be too much interested in Mono](http://forums.dotnetfoundation.org/t/compiling-net-core-code-on-linux-os-x/302/4?u=xameeramir). Not talking about [mobiles](http://stackoverflow.com/a/30550090/2404470) but web may be a big pain in long run – Zameer Ansari Jan 06 '16 at 19:45
  • That thread is about compiling .net core apps on Linux, for the moment you need mono but in the future you will not. About Mono/.net Core, until .net Core catches the actual .net Framework functionality, Mono will be needed to run .net applications on non-windows machines. And even then, they plan to merge the .net CORE functionality on top of mono, so using mono is safe for at least 5 or 6 years (but I belive it will be safe for a very longer term). – Gusman Jan 06 '16 at 19:52
  • @Gusman Particularly my problem was the built in `MySql membership provider`. Afterwards, hosting on [`mod_mono`](http://www.mono-project.com/docs/web/mod_mono/) was a big pain. Have you ever worked with `mod_mono`? – Zameer Ansari Jan 06 '16 at 19:57
  • 1
    Well, I did but it's a bit a pain in the ass, finally I ended using NGINX/FastCGI/XSP and it worked flawlessly. – Gusman Jan 06 '16 at 20:00
  • 1
    Take a look at the latest documentation on how to host ASP .net pages on Mono, if you tried it some time ago it will have a lot of new info as Xamarin rewrote all the help: http://www.mono-project.com/docs/web/aspnet/ – Gusman Jan 06 '16 at 20:03
  • @Gusman Maybe, I will give Nginx a try. I'm curious to meet [someone](http://stackoverflow.com/users) who hosted ASP.NET on Apache using mod_mono on Mono. I'll start everything from scratch. – Zameer Ansari Jan 06 '16 at 20:05

2 Answers2

1

Moving from .NET to .NET Core is a huge move, especially if you're going to take advantage of Core. There is not currently a one click port, and I doubt you'll ever get a one-click migration like migrating from a VS 2013 project to a VS 2015 project. The entire startup flow is different, and to automate switching to that would be incredibly difficult. For now, the way I am looking at it is that moving to .NET Core is essentially a rewrite. As to whether that is worth it to you for your project - well that's really hard to say and also probably not well suited to that site.

That said, if you do rewrite you can probably bring along a lot of your business logic. You just will need to redo a lot of the other structure.

Feasoron
  • 3,471
  • 3
  • 23
  • 34
0

There's no easy way to move a project from .NET Framework to .NET Core. Possibly you'll need to rewrite or start from scratch.

There are some major differences between two

  • Format of configuration files (web.config vs appsettings.json)
  • Used libraries
  • Startup files (Global.asax vs Startup.cs)
  • Lack of static objects in .Net Core. Like Session and Application objects - which is a good thing btw.
  • Many of the .Net Framework libraries are dependant on app.config/web.config files
mdemir
  • 112
  • 2
  • 10