References to .NET assemblies on server 2008 - asp.net

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.

Related

Pipeline Development with ASP.NET

Microsoft offers Pipeline Development via its Extensibility framework where the application can consume External Addins. I have successfully developed an extensible application on a Windows Console Project.
Now I need to implement an extensible website which accepts Addins, I googled for days for guidelines to do so, unfortunately I couldn't find any resources.
So, my question: is it possible to do that ? if yes can you provide any resources to learn from ?
I found out that you can't use M.A.F with Asp.Net because the Grabdge Collection will be very ugly.
Instead if someone ever will counterpart this question, The answer is:
You will need to use M.E.F (Managed Extensibility Framework) which comes as part of .Net 4.0+

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

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

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.

Managing breaking changes when upgrading application to ASP.Net vNext

I understand that ASP.Net vNext is still in early preview, but I keep hearing mention that:
the ASP.NET team had to include breaking changes in vNext.
ref: http://www.asp.net/vnext/overview/aspnet-vnext/getting-started-with-aspnet-vnext-and-visual-studio
Based on what we know today, do we have any idea about what will be involved when we need to upgrade to the next version of ASP.Net? What breaking changes will need to be attended to manually?
So I don't believe that Asp.Net vNext is finished enough to be able to answer this question. Watching the Repos a lot of the namespaces/methods are still getting refactored/moved around.
This being said it is important to understand that vNext is a complete re-write of MVC and WEB API. A lot of the conventions are the same so most of your Views won't need to be changed but any code that relies on HttpContext.Current or anything else from the System.Web namespace will have to be refactored as vNext will no longer be using System.Web.

Made a website in ASP.NET 4.0, my web host is on ASP.NET 2.0

I developed a website using Microsoft Visual Web Developer 2010. I'm not a serious programmer, but I can get by if the software is user-friendly enough. Anyway, I have come to learn that the website I developed was on ASP.NET 4.0 -- I think it might be 4.0.30319, as I look in my computer-->c:/-->windows-->microsoft.net-->framework.
Anyway, the webhosting company I'm with has ASP.NET 2.0 installed on their servers. Consequently, when I uploaded my site, I get a runtime error, telling me that my web.config is wrong, or whatever. But I'm positive that it's because my website is in 4.0, and their servers are on 2.0.
Well, this is a company website, so it needs to get up ASAP. I know I could switch hosts and all that, but does anybody know of an easier fix? I tried deleting the web.config and the site loaded, but it was all screwed up. The site works fine in my localhost.
So the long and short of it -- is there anything I can do to make my site work on a server that has only the ASP.NET 2.0 framework?
In short; no. It would probably be faster for you to get a new host than try to backport your site to 2.0, unless it is extremely simple. But 4.0 code won't run on a 2.0 site.
If you don't want to change hosting company, the only way is to 'downgrade' your site to .NET 2.0:
Right click on your project -> properties -> build -> target framework
PS
this will probably involve a (big) amount of changes to your code.
You either need to change the framework of the site or upgrade your host.
What you're asking is "how do I get an application that requires Windows 7 to run on Windows 98?"
You may be able to push the DLLs to the site (specifying they are content files and the site can then include them) but this isn't easy by any means (nor is it 100% fool-proof).

Resources