Do i need ASP.Net core if I have no plans to host my app anywhere other than IIS - asp.net

I am going to start a ASP.Net project tomorrow.
ASP.Net with Web API, Angular 2 are in my plans, but I am concerned about .Net core as my project life time will be 3 years.

Here's my view of your situation if you do not have any future plans to migrate from Windows platform.
I do not have much experience with .Net Core, but I think .NET framework can offer much more than .NET core a this point. It's more tested, it's older which means it is probably more stable and not prone to changes as younger libraries.
Example for, Entity Framework Core is still missing some features which are offered in standard Entity Framework.
I'm not saying that this will not change, just trying to describe current situation.
For more detailed help, I guess you should post more information about your project.

The AspNetCoreModule has to be installed on your server and is part of the ASP.NET Core Server Hosting Bundle.
For detail information of installing and configuration. Please visit the following website.
https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS

Actually you can use ASP.NET Core with full .net framework. You're not obligated to use it in a combination with dotnet core.

In the end it depends on how much weight you give to the different arguments.
Generally speaking I vote for ASP.NET Core especially for a new project. You will never know how long the lifetime of the project will be (maybe the anticipated three years will be extended). I list some arguments that came to my mind - and some of them will gain or loose some weight over time.
Pros for ASP.NET Core
Faster. The ASP.NET Core Team and the community put much effort to make ASP.NET Core one of the fastest Web Frameworks. It is the first time I have heard that people are proud of some benchmarks.
New framework and in active development with a faster and more fine tuned release cycle. I expect new features to appear on ASP.NET Core faster then (if at all on classic ASP.NET).
Although Cross-Plattform is not necessary for you now - it will be easier for you to make the move (e.g. Linux) in the future.
Starting on Windows you can run you application on top off the full .net framework and use the magnitude of third party libraries.
Pros for ASP.NET (classic)
Robust - many years of experience in production
Feature complete (compared to ASP.NET Core, Entity Framework Core, .core)
Because of its lifetime you will find more people with indepth knowledge

Related

.NET framework or .NET Core for Web API for legacy SQL Server database

I am working on my first .NET Web API. I have an existing .NET Windows Forms application using a SQL Server 2008 R2 database, and now I need to write a new app: a straightforward Android tablet application that will access the same database. These apps for just for internal use; not outside the one company.
I have been on a long journey though many tutorials, blogs and posts here, including this I'm lost. What happened to ASP.NET MVC 5? super helpful explanation of .net products and versions. But over and over I get hopelessly confused about which product I should choose to write the Web API. I can't always tell from some of the tutorials whether the ideas and techniques and configurations apply to both .NET Core and .NET Framework, or just one, and if the tutorial works with current versions. I am using Visual Studio 2019.
Does anyone have a recommendation for whether I should be using .NET Framework 4.8, or the new .NET Core?
I do not find this guidance from Microsoft helpful.
I think I should probably use Entity Framework to generate code from my existing database, but I also think I could pretty quickly code SQL calls right into the Web API controllers as I have seen done in some tutorials. Is that considered a bad practice?
Thank you for any steering you might offer.

Can someone please explain the difference between ASP.NET MVC & .NET Core 3.1

Hello I have built an application using asp.net MVC, this project is all working well but I am finding a lot of documentation with Stripe has documentation depreciated, however, the documentation is fine for asp.net core
Is it a massive change between the two types, why doesn't it seem to work with my one. I am new to all of this but it doesn't really make a lot of sense to me so please explain in lamens terms and link some articles if it would help :)
I understand your confusion :D I've worked with ASP.NET for very long (since web forms). I'll try to explain to the best of my understanding.
MVC is a design pattern that has seen a lot of success and has been adapted widely by several frameworks. ASP.NET MVC is the dot net implementation of the MCV pattern.
ASP.NET Core is a redesign of ASP.NET with a lot of new features and benefits. The biggest advertised differences is the fact that DOT NET CORE is open source and cross platform.
In an asp.net core web application you will still see the MVC pattern with several improvements since ASP.NET MVC.
If your project works perfectly you don't have to do a complete redesign. The frameworks will keep updating and as developers we need to stay updated but we can't go and redesign every project. New projects are a different story. If you start something new definitely consider using ASP.NET Core.
Here is one of Microsoft's docs that helps understand the difference.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
If you split your application into different projects for the front-end stuff, business logic, and data access, it shouldn't be too painful to port it over. The business and data access code should mostly work the same way. it's just the bit of MVC presentation stuff that will be markedly different.

Best practise to migrate Web Forms to ASP.NET Core MVC

I am trying to migrate a project from classic ASP.Net Web Forms to ASP.NET MVC.
While I have read through http://www.codeproject.com/Articles/38778/ASP-NET-WebForms-and-ASP-NET-MVC-in-Harmony. I have a basic idea on how the code structure, libraries and routing should be done.
For your information, the scope of my existing project is around 400 pages and 300 tables.
On top of my head I have two approaches:
Start from stretch, rewriting the whole system - Obviously this would require intensive work and take a long time. Any change made on existing system would need a duplicate change made to the new system.
Migrate the page one each - I still have a rebuild the entire core library (for accessing db), and get the page migrated one by one. For this I would assume to have two core libraries (new and old) running simultaneously with different pages connect to one of those.
Would anyone have similar experience and advise a proper way to start?
For this complete revamp I may also target at the latest technology - .NET Core and MVC6, by taking these would I have extra advantage, or some blockages I would have to take care of?
Any suggestion and opinions are appreciated. Cheers.
Microsoft is a bit hush hush on the subject but the WebForms engine is probably never going to make its way to ASP.NET Core. One might think that MS is waiting to see if the community is calling for a port, but I think they're trying to kill it discretely (not like Silverlight).
Why? Because it proved to be a bad good idea on the long run, easy to use at first, but extremely complex to master (because of viewstate and page lifecycle), with a tendency to allow average developers to build very tedious application (in french we say steam factories). Also it was very poorly adapted to modern web development (Ajax, unit testing, IoC). They tried to fix it with a couple of tweaks, but the overall architecture is just not adapted to this kind of things. MVC is a treat in comparison!
To answer your question, it's not really possible to migrate WebForms to MVC, because those are quite different architectures, and of course the architecture is what an application sits on top on, so if you change it, you might as well rewrite it from scratch.
What can help you a lot is if your app is divided in tiers (business, data access, UI). If it's not the case, you could start by doing this, properly separating the UI project from the rest. Then you would just have to rewrite the ASP.NET project and not the rest.
There are some useful resources I'd like to share with the StackOverflow community just in case you are having troubles to decide what to do:
modernization of your existing Web Forms app
migration to MVC or Core
or whether to start a new project on Web Forms, MVC and Core.
Here you go:
https://www.telerik.com/blogs/review-of-telerik-toolsets-for-aspnet-web-forms-core
Modernizing ASP.NET Web Forms Applications by Tomáš Herceg (Microsoft MVP ) - https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-1
Migrating Old ASP.NET Applications to .NET Core by Edi Wang (Microsoft MVP) - https://edi.wang/post/2018/10/31/migrating-old-aspnet-applications-to-net-core
Choose between ASP.NET and ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
Migrate from ASP.NET to ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1
i have come across below links
https://www.youtube.com/watch?v=CZuqMrWSano
https://www.dotvvm.com/blog/59/Modernizing-ASP-NET-Web-Forms-applications-with-DotVVM
DotVVM package helps us to migrate ASP.Net Web Forms migration to ASP.NET Core without re-writting completely.
i have not tried any production application. still have tried some sample pages. you can try this out.
I can agree that for many cases a re-write of an ASP.NET application where WebForms is used widely may do not provide any business value.
Therefore we decided to use our experience with ASP NET WebForms to develop a highly compatible port of WebForms for ASP NET Core / .NET 6.0.
We use the solution in our own ASP NET WebForms-based products and projects as well as a licensable component library.
So the Forms can still be used and you can focus on the .NET CORE/6 migration.

References to .NET assemblies on server 2008

I've recently just attempted to deploy a site (it's a web api project) I worked on a Win 2K8 server with IIS installed and the .NET 4.5 framework installed. i was surprised when it didn't work. It basically acted as if it had never heard of the MVC-style routing notion; because it was issuing a controller/action/id type request it didn't know to invoke the routing engine and map this to controller actions.
I eventually took the fairly extreme and silly approach of setting copylocal = true for all assemblies in the project, even the ones that I know must be in the GAC. Bin-deploying it this way works.
So....my question is this - how do I know which need to be copied local and which don't? I mean, I installed the .NET framework 4.5 on the server, and ultimately it seems as if the libraries involved should have been resolved because the .NET framework was installed? Of course the nuget packages all need to be copylocal=true, but within the set of MS standard libraries it seems as if the web site still doesn't find all of them.
Is there a rule I can follow that helps me understand which ones I need to copy locally?
If ASP.NET MVC 4 is the first version you use, and you don't learn every aspects of the framework from a good enough book, I hope you spend some time to review related articles on the Internet to get better understanding,
http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx
http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx/
ASP.NET MVC is not bundled in .NET Framework, so most of the binaries you refer to must be set as copylocal=true. This must be painful for beginners, but experienced users are already familiar with that.

New to ASP.NET: Webforms vs MVC2

I am new to ASP.NET Development and can't decide between developing with Webforms or MVC 2. Nevermind the pros and cons of each. I've seen mixed opinions of each. But which method would be the best for someone who has no prior experience in ASP.NET or C#?
If your answer is: learn both, then which should I learn first? MVC 2 or Webforms?
I was in a similar situation to you a year ago. I'm a Computer Science student, well finished my course around a month ago. First two years of my course I worked with Java, PHP, Oracle, MySQL. This actually landed me an industrial placement at Oracle where I used their ADF which was Java based.
Anyway all of this made me start thinking about what I wanted to use for my final year project and with no experience of Microsoft technologies began to venture down that path. I wasn't aware of ASP.NET MVC and spent time learning ASP.NET WebForms. I liked the easy style of development, drag and drop is a very quick way of developing small sites. However I also disliked the lack of control I had and the simplicity, I didn't feel overly challenged.
During my final year I started to research Model View Controller and how it suits web applications. From this I came across ASP.NET MVC and in my opinion its far better than ASP.NET WebForms. There seems to be an emerging trend in MVC frameworks for web applications and this seems to be the hot technology to build web applications in.
Now finished I can say that teaching myself ASP.NET MVC was one of the best things I did. I don't know if you're British based, but only two Universities in Britain teach .NET. This made getting a graduate job much easier and I stood out from .NET candidates because I was from a Java course, the same as yourself.
The transition from Java to .NET is not particularly difficult all the theory and concepts are the same. Also ASP.NET MVC is becoming quite popular among businesses which specialise in the Microsoft technology stack. As it is quite a new technology learning now whilst young will be an advantage. I've ended up in a job where the company are rewritting their application from ASP.NET WebForms to MVC and only myself and the senior developer have ever used MVC leading to quite a large role in the project.
If you're interested my final year research can be found here and I have a chapter on ASP.NET WebForms and MVC
My source code is also on my site but its mainly MVC 1.0 not 2.0
Tough question.
What's your background in web development? Are you familiar with the MVC pattern?
Are you learning it for a job?
ASP.NET Web Forms are easier for beginners, as it hides much of the underlying implementation details of the ASP.NET engine.
ASP.NET MVC requires a deeper understanding of concepts such as routing and HTTP methods.
But yes - you should learn both.
As MVC is a new platform for developing ASP.NET Web Applications, i would learn Web Forms first. That way you will appreciate the benefits of MVC more when you contrast it to Web Forms.
if you want to get your hands dirty and really understand how the web works, go MVC
if you want to drag and drop your way to a functional but overhead loaded website, use webforms.
really, this question is pretty difficult to answer not knowing your background. if you're comfortable with html, css, javascript it may not be too difficult to pick up MVC. if you're new to the web entirely, it can be daunting to learn that many technologies all at once and webforms abstracts a lot of that kind of stuff for you.
There's a third option, especially useful for developers new to ASP.NET. You can use ASP.NET Web Pages, which is different from ASP.NET Web Forms. ASP.NET Web Pages is great for new developers as well as developers new to Web development. Also, it has a good path to migrate up to the complexity of ASP.NET MVC. In fact, the latest release of ASP.NET MVC and the latest release of ASP.NET Web Pages both use the same view engine.
Here is a link to the complete ASP.NET Web Pages book:
Getting Started with WebMatrix and ASP.NET Web Pages
Also, here is the complete WebMatrix Content Guide:
WebMatrix Content Guide
Here's the description:
WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites. It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.

Resources