Migrating a classic ASP.NET MVC5 project which uses Ninject to Owin - asp.net

I have an ASP.NET MVC5 application which was created in the times of MVC3. During the times I've upgraded over and over until the current state which uses MVC5 and Ninject.
I use Ninject with the Nuget packages Ninject.Web.Common and Ninject.MVC5. To tell the truth I'm not even sure the latter is needed because MVC5 seems to use its built-in IDependencyResolver interface whenever it's needed.
The applicaion is run inside IIS, and all the setup and configuration is done in Global.asax file and Web.config.
Now we reached a point where we would like to use SignalR for a submodule, and so there is time to migrate the whole application to Owin as SignalR uses that too. I wouldn't like to make a mess with mixing several technologies.
I couldn't actually find any good guides about the required steps and what issues can occur, what with should take care of.
Has anybody done a similar migration?

Related

Converting Existing Dnn Application to .Net core

Converting Existing Dnn Application to .Net core
I have a application of dnn having ado which I need to convert to .net core with ado web application.
In this I have to move only two modules from the application.
what i have already tried so far.
cleaned the database from the dnn tables.
changed the ascx pages to partial views.
changing the ascx.cs pages to the controller.
Need Recommendations for fast conversion and if I can follow any pattern.
Given the nature of the way that the DNN Platform works, there is not a fast transition to a stand-alone installation.
There is no Microsoft documented "Fast" transition plan from Web-Forms to .NET Core as well, so nothing that you can try to mimic from other installations either.
Since you will need to extract dependencies on DNN as well as dependencies on System.Web that are no longer available, it is best to treat such a transition as a re-write, rather than trying to "simply translate" as there isn't any method to do so.

How to leverage ServiceStack Session/Cache in ASP.NET 4 Web forms website?

Having read bits and pieces of source code on github ISession and SessionFactory and a bunch of other files (they are gems of coding goodness) I'd like to be able to pull the session component into a legacy VB.Net ASP.NET Web forms website, and have it wrap my existing ServiceStack Caching (implemented Memcached). Is there a NuGet package that I can use?, sort of like MVC MVC PowerPack.
Update
After a bit more digging, I have found Starter ASP.NET which may have the features I need, but I reluctant to install that into our dev main line at the moment.
Have a look at MVC Integration and ServiceStack Integration docs which show how you can use the ServiceStackController in the ServiceStack.Mvc package to access ServiceStack dependencies.

New ASP.NET project

When creating a new web project in ASP.NET are you better off to use the "ASP.NET empty web application" or the "asp.net web forms application"
I would recommend against even bothering with ASP.Net Web Forms. It was an interesting idea that proved to be unweildy in practical applications. The entire web development industry is moving towards some kind of MVC framework or another whether you're using PHP, Ruby or ASP.Net so you're best off using that.
Of course there are still a lot of ASP.Net Web Forms applications out there and they're likely to exist for some time into the future so there is some benefit to learning the technology but I would avoid it for any new projects.
As per your question if you should use the empty project or not it doesn't really make a difference. If you're just starting out the populated project can give you a basic idea of how the structure works but if you're comfortable enough building it from scratch then go with the empty project.
It depends on what you want to do.
Generally speaking, there are three kinds of ASP.NET application project:
Web Forms - what ASP.NET was originally back in 2001. Its use is discouraged in modern and greenfield applications because it is built-around outdated ideas about how web applications should work.
MVC - The new hotness. Try to use this. StackOverflow is built using this.
Everything else - too many to list, but this generally requires you create an empty project and do everything from scratch using IHttpHandler.
If you're new to ASP.NET I strongly recommend avoiding the two project types you listed as they're both for Web Forms; consider using the "ASP.NET MVC Application" options instead - if you're using VS2008 then you need to download and install the ASP.NET MVC 2 add-on. VS2010 and later come with the MVC templates preinstalled.
You might want to use the Empty Web Application project template if you want to work from scratch using IHttpHandler, but you sound new to this, so I recommend avoiding it.

6-month migration path from asp to asp.net - is it worth interopping?

I'm going to migrate from asp to asp.net over the next few months. Is it worth building .NET interop components and calling them through COM wrappers in ASP to move things along? If so - what types of components would you make? Data access? It's largely a CRUD and reporting application.
I wouldn't go down the COM path. Considering both apps are web based and the type of operations or transaction are fairly standard, I suggest you look at web services rather than com object and building throwing away wrappers. These web services can immediately be consumed as building block in your new ASP.NET application project too.
It's worth doing but go directly to ASP.NET MVC, it is most similar to Classic ASP style than regular .NET
I'm doing something similar but not a full migration. I decided to go the COM route so that I could take advantage of .NET while still having reusable components down the road in case a full rewrite were to become necessary. The COM route is pretty straight forward and is very trivial to glue into ASP code. I would recommend it if you want to build a piece at a time.
In my case I made some Active Directory components and some other general purpose ones.

ASP.net using iframes

I have been tasked with a project where I am to add a new application and have it within an older application (web applications). This is an internal application and management decided that they want it wrapped in this older app. The older application is a ASP.net web app using the 3.5 framework.
My original plan was to use jQuery and Web Services (using JSON and AJAX). My team-mate on the project really wants to use Entity Framework (4.0). As we may be sharing the same look and feel the data is a different database altogether.
After several attempts yesterday, we found some issues. We created a project inside the original solution that targets the 4.0 framework. I created a WebService on the project, but when I tried to call the webservice from the 3.5 project I didn't get an error but I didn't get the return string. I was watching on Firebug and did not see the GET call either.
My team-mate did a little more research and found out about the cross-domain issue and jQuery, so it seems that we are limited with the Entity Framework (3.5) and remaining on the .net Framework (3.5). We did try changing the dataType to jsonp but calling the WebService still didn't work.
However, I was wondering, really management wants the project wrapped inside this other project for consistency sake (navigation, design and so forth). Is there a way to have the 3.5 project display our code that is being generated from the 4.0 project (a totally different solution and probably a different server)? I'm thinking the way the iFrame used to work but I don't want to use an iFrame at all.
One way to solve this problem would be to stand up a WCF webservice to handle the database calls. You could develop your "data layer" with .NET 4 and EF4, then call that layer from your .NET 3.5 ASP.NET application. It's not the absolute cleanest solution, but it would allow you to get the benefits of the newer version of EF.

Resources