How to upgrade my existing .net project to asp.net core 1.0? - asp.net

I am in the middle of the development of a project.I am using asp.net framework 4.5.So far what I have developed, I have to publish it on a Linux server. So i fount that, I will have to upgrade my existing project to ASP.NET Core 1.0 in order to publish on Linux server. Can anyone please suggest me how can I achieve my goal?

You may encounter a couple of issues and looks for different solutions but a general guide can be found here: Migrating From ASP.NET MVC to ASP.NET Core MVC
For specific errors when the general migration will be done, it's worth to take a look at ASP.NET Core's GitHub page as a lot of issues that can occur during migration is described there.

Related

Is running Umbraco within an ASP.NET Core API possible?

Is it possible to utilize Umbraco with an ASP.NET Core API project?
Can these two techs work together or do I have to use .NET 4.x ?
:::::::::::::::::::::::: UPDATE ::::::::::::::::::::::::
I accepted #mortenbock's answer, but I strongly suggest to people interested in this question to also read the comments below, where #Tseng has provided some very useful answers.
Umbraco will not run on .Net Core in the current version 7.x
I believe they are working towards making it possible in version 9, which is still a long way off.
See the System requirements for Umbraco 8: IIS is still required and it will not run on ASP.NET Core
Shannon Deminick has been doing some PoC work on it: his blog post about "Umbraco CLI running on ASP.NET Core" has more details
You could use Umbraco as a headless CMS in a separate application, and then consume the content from you .Net Core application via REST or similar. At codegarden 2016 an example to use Umbraco CMS as an headless cms with custom frontend was shown

How to port to .NET core?

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?
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.
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

How to upgrade existing ASP.NET application to ASP.NET vNext

I have not been able to find any proper documentation on how to upgrade an ASP.NET application to ASP.NET vNext.
I would like to switch hosting servers and from what I have learnt, you can host ASP.NET vNext not only on Windows, but also on Linux, Mac, etc.
I found this article: Upgrade to .NET vNext but it did not really help to achieve my goal.
So my question is: what are the important steps to take when upgrading an existing ASP.NET application to ASP.NET vNext?
ASP.NET 5 (vNext) is currently in beta, so you're not going to find much documentation as a lot of the available libraries are still changing. Likewise, the Kestrel HTTP server, for cross-platform hosting is also currently under development. You can download the release candidate of Visual Studio 2015 here and play around with it yourself, but don't expect any official upgrade documentation until it's release.
I believe there won't be a direct upgrade option. The architecture diverges so much it makes it impractical to 'upgrade' existing project into vNext.
It is easier if you rewrite your application instead.

What is ASP.NET vNext?

Can anybody tell me what is ASP.NET vNext?
Every new version on .Net is something like .NET 1.0, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0 then why this version is not something like ASP.NET 6.0?
vNext is just the name given to product in the pre-release mode, like c# vNext which will apparently be released as C# 6.0, maybe ASP.NET vNext will have a numbering when it releases.
What is ASP.NET vNext?
Microsoft ASP.NET vNext is a smaller and efficient framework as a result of rebuilding the libraries from ground up.
What's new in vNext
Cloud-optimized versions of MVC, Web API, Web Pages, SignalR, and Entity Framework.
MVC, Web API, and Web Pages will be merged into one framework, called MVC 6.
MVC 6 has no dependency on System.Web. The result is a leaner framework, with faster startup time and lower memory consumption.
vNext is host agnostic. You can host your app in IIS, or self-host in a custom process.
Dependency injection is built into the framework. Use your preferred IoC container to register dependencies.
vNext uses the Roslyn compiler to compile code dynamically. You will be able to edit a code file, refresh the browser, and see the changes without rebuilding the project.
vNext is open source and cross platform.
More information:
Overview on asp.net
Getting started with ASP.NET vNext
Blogpost by Scott Hanselman
Blogpost by David Fowler
Contributing to ASP.NET vNext
Sample ASP.NET vNext applications
ASP.NET vNext is the next version of ASP.NET, but it hasn't shipped yet, so it is not an official version. "vNext" is just a working title.
ASP.NET vNext was the code-name for the next generation of ASP.NET, whose official name is ASP.NET 5. As of now ASP.NET 5 is not yet finished and documentation about can be found at http://asp.net/vnext.
ASP.NET 5 is not just an evolution of the previous version(s), it is rebuilt from the ground. Existing ASP.NET applications will run on ASP.NET 5 without modifications, but to take advantage of the new features, such applications will have to be ported to the new version.
Here's a little excerpt of what http://asp.net has to say about ASP.NET 5:
ASP.NET 5 is a lean .NET stack for building modern web apps. We built it from the ground up to provide an optimized development framework for apps that are either deployed to the cloud or run on-premises. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions.
ASP.NET 5 includes the following features:
New flexible and cross-platform runtime
New modular HTTP request pipeline
Cloud-ready environment configuration
Unified programming model that combines MVC, Web API, and Web Pages
Ability to see changes without re-building the project
Side-by-side versioning of the .NET Framework
Ability to self-host or host on IIS
New tools in Visual Studio 2015
Open source in GitHub
The changes we made for ASP.NET 5 were based on customer requests and feedback. These changes simplify development, hosting, and maintenance, and are targeted to modern web apps.
Your legacy apps will run on the new version of the ASP.NET without any modifications. However, to take advantage of the new features in ASP.NET 5, you will need to port your existing code to the new framework. You will find many similarities between ASP.NET 5 and earlier versions of ASP.NET, so porting code involves fixing particular issues rather than re-writing the app.

Upgrading ASP.NET from version 1.1 to 2.0 - Any Gotchas?

I know we are really behind the times here, but we are just about to upgrade from .NET 1.1 to .NET 2.0.
Thank you for your sympathy.
Anyhow, are there any gotchas we should look out for?
Do you have any general advice before we jump in?
Please do not post telling me to go straight to 3.5: 2.0 is all we're allowed!
We're using mostly C#.
Yes. The most important thing for you to know is to use a Web Application Project, not a Web Site. Web Sites use a totally different compilation model and migration is pretty much a disaster. Web Application Projects are much more similar to how things worked in 1.1.
We also had an intermittent problem with redirecting from the login screen, but according to Google, we were basically the only ones who had that problem - we've since resolved it.
Most of the other problems we ran into were small and easy to navigate, and the overall experience was a net improvement.
Here is my recommendation before upgrading:
If you are used to use Visual Studio 2003, you will need to go for VS2005. You will have to convert the old solutions and projects so that it will be compatible with VS2005. Make sure to have a backup of the project you're going to convert so that you can roll back or even use it as source for any modification you may need to the converted projects.
If you're developing web applications using .NET 1.1, make sure that all the virtual directories and applications in the IIS is configured to work with ASP.NET 2.0. You may need also to configure a new Application Pool for your .NET 2.0 applications.
If you're using any third party libraries in your .NET 1.1 projects, you may need to confirm its compatibility with .NET 2.0 projects. Some old libraries used in .NET 1.1 are not compatible with 2.0.
One gotcha is home-grown 1.1 implementations of .NET 2.0 stuff (that was missing in 1.1) like RegistryHandler and so forth. Sometimes your newly-ported 2.0 code will look like it's properly using a 2.0 class when it's really using the home-grown version.
Deployment is another gotcha, if you're upgrading an already-deployed app. You have to switch the .NET version in IIS from 1.1 to 2.0.
I remember we had to change some client scripts, because the way ClientIDs are generated for server controls changed from ASP.NET 1.1 to 2.0.
I don't remember the exact circumstances, but some IDs which previously wer prefixed ctl0_ became ctl00_...

Resources