Silverlight to ASP.net MVC migration - asp.net-mvc

I am tasked with migrating a Silverlight application to ASP.net MVC5. The challenge is that some of the modules have already been built in an MVC app that can run stand-alone or can load from within the Silverlight application. The existing MVC application has been developed over last 2-3 years by several developers of varying skillsets and the code is not in very good shape. The code has very poor coding standards adherence and poor re-usability, no coded unit tests, no DI, lots of inline styling, etc.
I want to start afresh with a new MVC project for the Silverlight migration so that I can try and address the issues in the current MVC app. Eventually, I want to reach a point where the Silverlight and the old MVC apps can be completely discarded and the new MVC app becomes the only one running. However, until the migration is complete, all three need to coexist. With the Silverlight application, I do not foresee a problem as I can tweak it to load the MVC pages from two different MVC sites. However, the main challenge I am facing is in figuring out a strategy so that users can access the new modules from the new MVC app from the old app until I migrate the old modules to the new app. It would not be feasible to make users access two different web apps for different features.
Some of the possibilities I have explored are,
hosting the new application separately but loading the pages into iframes from the old MVC site.
using something like Razor Generator to precompile the new project and refer it from the old application.
I am not very sure if the above are the best of ideas. I would greatly appreciate any suggestion to help me think and proceed in the right direction. Would also love to hear if there is a better/more appropriate approach to solve this problem.

Related

Tips for migrating a very large ASP.NET MVC 5.2 SaaS application to ASP.NET MVC Core

I'm looking for some advice on how to go about a very large and complex migration of a SaaS ASP.NET MVC 5.2 web application. Some general stats:
~630 Controllers
~1020 aspx files
~840 ascx files
~1000 Entity classes for Linq2SQL (our data model has ~1K tables)
We'd like to target migrating to ASP.NET MVC Core on .NET 6, and possibly to Entity Framework Core.
To make things a little more complicated, our application is a SaaS where we release a new version every 2 or 3 months. I don't know, but I feel like this is going to be impossible to do in a single release given the scale. I feel like this is going to be a project that spans 3 or more releases, so we need to figure out how to do this incrementally.
Essentially, my thought is that we will deploy two applications moving forward, and migrate pages incrementally from the old application to the new one. This should all be seamless to the end user. They should not be able to tell which pages are being served from the old MVC, and which ones are being served from the new one. We use nginx for our load balancer. I'm hoping this is something nginx can help us with.
This is all happening while new features are still expected to be added in the upcoming releases.
We have a team of about 25 developers. My guess is most of them are still going to be building new features, and maybe 3-5 of them will be working on this migration..
So, a couple of questions:
Does this seem like a reasonable approach to this migration?
Has anybody out there gone through a migration like this? Any advice? What am I glossing over?

using ASP.NET MVC and EXT JS together

I'd like to use for my next project Ext js and ASP.NET MVC.
I'm wondering what would be the best way of using this two framework together. So far I did some project using ASP.NET MVC, where every action method returned a view and reloaded the page. The Ext js mvc application uses a single page approach.
As I'm pretty new to ext js so I'm wondering if someone could share some experiences of building real world application using this two frameworks.
You can use extjs as you think is better for you. You can use its components as simple widgets or create a full javascript (extjs) client. However, which are the real requirements? a single page client or a traditional client?
In our current project we started using ASP.Net MVC Framework with extjs widgets, it was ok for a while but the customer wanted more and more sophisticated UI and a better user experince (among other thing) then, we changed the app, we left MVC models and controllers (views were removed) and we created a full javascript client with extjs 4.1.
After that we realized we were using an ASP M_C framework (with no views) and that was a nonsense so, we took the ASP MVC project away and replaced it by a WCF Rest service (it also could be done with an ASP.Net Web Api).
We feel proud of our decision and the resulting design. If you can, if you know extjs (learning it is rather hard) and javascript and, if you have support to your decision then, keep your application splitted in two:
a server-side service/api and,
a full javascript application.
Good luck!
I'm not sure I'd agree with the answer by #lontivero, I'm currently working on a project using ASP.NET MVC as the backend and ExtJS as the front.
You do, as pointed out, loose the V from the ASP.NET MVC stack and you end up needing to duplicate you C# view models in you ExtJS Models on the client side but I've found using MVC as a backend (effectively as a rest based collection of Json end points) absolutely fine.
You can utilise the model binding, model validation in MVC whilst leveraging the full client side js app in Ext.
I'm curious as to the points you didn't get on with using this structure (I'm not saying it's perfect, but it does seem to work)
We used Ext.NET (versions 0.x-1.x) in our previous projects. Even after a comprehensive effort to upgrade our projects to the (now current) version, we had to drop Ext.Net 2.x out.
If it fits you, it can help.
The main problems with Ext.Net were (several) incompatibilities with ASP.NET and a lack of trust. They used to keep their schedule, it's far from it for last 2 years or so. And they are behind ExtJS.

Converting a project from webforms to MVC over time - can this be done?

I'm working on a typical 3-tiered webforms app backed by a SQL server database. In addition, several of the forms call a DAL layer that gets data from a DB2 database on a host, and this logic is well encapsulated. There are about 80 forms in this project but I'd say at least 50 of them are so similar that they would share the same 2 or 3 views.
So tell me if you think this is a recipe for disaster...I've been asked to explore the possibility of converting this project to MVC in an incremental manner. We would never get the ok from management to take the time just to convert the project in one fell swoop. It would have to be done incrementally within our business-related releases - i.e., we have releases every few months and I've been asked to explore how we could make smaller changes with each release to work our way towards MVC. Since they are 2 totally different frameworks I don't immediately see how this can be done. One idea I have is to carve out the UI piece, put that into an MVC project, and have the controllers call down to the DAL that we have now. Can you even have a solution with different project types in it? Any other ideas?
I have done something similar in recent past. I have a running application developed in ASP .Net and Oracle. That application has several performance issues due to which we have to re factor that. And we all agreed that we should migrate it to MVC at the same time.
So, I created a new project MVCWebClient. In that new project we created our pages one by one. Now user use old application's login page to log into our application and we changed the links which point to our new application.
Everything is working smoothly except session. Because we stored uid/pwd in session, so I created a dummy page which transfer the session parameters to our MVC application.
For example my existing application has following URLS:-
/Login.aspx
/Home.aspx
/Finance/Payslip.aspx
and I created a integration page to transfer session like this
/Integration.aspx?urlRequest=/MVCApp/Finance/Payslip
and my main navigation links become like this
/Login.aspx
/Home.aspx
/Integration.aspx?urlRequest=/MVCApp/Finance/Payslip
Feel free to ask details if you are interested in my solution.

Why have or haven't you moved to ASP.NET MVC yet? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I find myself on the edge of trying out ASP.NET MVC but there is still "something" holding me back. Are you still waiting to try it, and if so, why? If you finally decided to use it, what helped you get over your hesitation?
I'm not worried about it from a technical point of view; I know the pros and cons of web forms vs ASP.NET MVC. My concerns are more on the practical side.
Will Microsoft continue to support ASP.NET MVC if they don't reach some critical threshold of developers/customers using it?
Are customers willing to try ASP.NET MVC? Have you had to convince a customer to use it? How did that go?
Are there major sites using ASP.NET MVC (besides SO)? Could you provide links if you have them?
Did you try ASP.NET MVC and found yourself regretting it? If so, what do you regret?
If you have any other concerns preventing you from using ASP.NET MVC, what are they?
If you had concerns but felt they were addressed and now use ASP.NET MVC, could you list them as well?
Will Microsoft continue to support ASP.NET MVC if they don't reach some critical threshold of developers/customers using it?
They will for sure.
Are customers willing to try ASP.NET MVC? Have you had to convince a customer to use it? How did that go?
Customers care about high quality products and price. Just convince them that Mvc will help to raise quality and lower price. Shouldn't be hard.
Are there major sites using ASP.NET MVC (besides SO)? Could you provide links if you have them?
Isn't it enough with SO? :)
Did you try ASP.NET MVC and found yourself regretting it? If so, what do you regret?
I did try and didn't regret it at all. It kills me being forced to work on web forms project again.
Go for it!
I believe ASP.NET MVC has reached that critical threshold, as evident by VS 2010 tooling, ASP.NET, MS employee blog and the extensive effort Microsoft put into the framework thus far. I don't see this framework perishing in the next decade (or two).
By customers, I assume you mean people that I build websites for? The only issue I find with ASP.NET is the hosting solutions. However, this issue is becoming moot as more affordable hosting solutions are found. But usually, if I believe in the technology and that it will work for my customer, my customer trusts me and agrees on it. The customer is also usually comforted by the fact that ASP.NET-MVC is a Microsoft product. Having a big company behind a technology is always a nice thing to have, since you can rest assured it will be supported for quite awhile with frequent updates.
ASP.NET MVC is a relatively new framework, and slow adoption of new technology is expected. But this is what I found: http://weblogs.asp.net/mikebosch/archive/2008/05/05/gallery-of-live-asp-net-mvc-sites.aspx . I think you'll see a big influx of websites using ASP.NET-MVC this year when VS 2010/.NET 4 are released with built-in support for ASP.NET MVC.
I never enjoyed developing with C#/ASP.NET more than when I started using ASP.NET-MVC. To a certain extent, ASP.NET-MVC forces you to write good code more so than WebForms due to ASP.NET-MVC inherit separation of concerns and easy customization. And the ability to control HTML output is essential, a feature that was difficult with ASP.NET-WebForms (pre 4.0).
I use MVC and hate it, especially, the front end, web form are far more better in the front end... With loads of javacript on the page, that means it is hard to maintain and take a longer time to develop and debug..
To do a very complicated page, the flexibility of MVC is limited, you will end up with using a lot of javascript control, and you know what? Different controls use different version of jquery, and they have conflict..
It is actually the javascript, and lack of UI flexibility that pulls me off, especially you are NOT working on your code
and we have more issues of browser compatability, with the new browsers coming, you are going to shoot yourself with MVC
MVC front end is very fast if your web site is not too big.. The backend of MVC is very good, it is the front end that blows it over
Why not? The rest of my team doesn't want to.
I have not yet actually tried coding up some ASP.Net MVC(looked at a few examples though) but the main thing holding us back from using it is that all of our code is currently written using Webforms.
Regarding Microsoft support ASP.Net. First Scott Guthrie, the VP of Development at MS is behind it, so that's one feather in its cap. Second its open source now so even if for some strange reason MS decides not to support it going forward you can still tweak it on your own if you need to. In addtion the MVC pattern is somethign that more and more web development platforms are using. It is a great pattern for web development and as a result I can't think of any reason MS wouldn't continue to support it.
If by customers you mean end users, honestly they shouldn't care how you implement the site. If by customers you mean consulting clients, if you can develop faster and they have the servers that can host it, I would think they would be open to it. On top of that youre MVC sites should use less bandwidth than a typical Web Forms web site (IMHO) mainly because there is a lot of additional stuff put into a Web Forms page (for example extra attributes in the HTML htat are tailored for web forms, ViewState) so that should be seen as a positive by them. Now if by customers you mean people integrating with you, then its also a plus since MVC makes it very easy to implement REST based web services (not that WFC doesn't but MVC works very nicely as well).
Hmm major sites using MVC, so far I've found a list here I also know of a number of apps at different companies where large scale MVC apps are in development. I wish I could give more detail, but unfortuantely I can't at the moment.
When I first started out with ASP.Net MVC I thought I was going to hate it. I wasn't a huge fan of Web Forms either, but MVC just felt like a step back to ASP development back before .Net came out. Then I started really getting into it and really finding the pattern is clean, concise, extensible, maintainable, and easy to pick up. Honestly I don't want to ever go back to Web Forms, and anytime I find myself doing a .Net web app I make a point of making it an MVC project.
You need to choose what's more appropriate to your product. Webforms has a few things to recommend it over mvc in some situations.
The big one is a developer working on in-house tools at small to medium shops. In these circumstances:
Large viewstates are not likely to be a problem, because your users typically have 100Mbit upload to your web server rather than a measly 128Kbit or less.
Javascript is likley to be supported by everyone
Development time matters more than widespread cross-browser compatibility or even nice design.
You're likely stuck working with inherited devs who used to do desktop/forms style development, or have a lot of churn among junior devs who don't really know web development.
All of those things together mean that webforms is still a very good fit. And let's be honest: a lot more programmers work at these small to medium in-house shops than do public internet work. So webforms isn't going anywhere.
That said, one of the big things coming up among these small shops is likely to be taking their internal tools and making them available offsite for telecommuters. In that situation, you need to start worrying more about WAN performance odd browser issues where MVC might be a better fit.
Dell is hiring masses of ASP.NET MVC developers in Texas and India for major work on many of their websites.
According to The Gu, ASP.NET MVC will have it's own product and development cycle. It is now 100% detached from ASP.NET WebForms and it's not going away.
Did you try ASP.NET MVC and found yourself regretting it? If so, what do you regret?
I do not regret trying out MVC in fact I love it. When I started it out I hated it I kept looking for the code behind file and was unsure at first how to get values out textboxes and stuff without going textbox1.Text;
Now I cringe every time I go back to webforms and wish I could write it in ASP.NET MVC because I just love how your working with html instead of using drag and drop controls that usually make your life alot harder if you got to customize them to much. I love how ASP.NET MVC likes to focus on good code like design patterns such as the Repository pattern and how to do unit test using TDD.
I have not picked up a book yet in MVC where they talked about how to make good code. I am not saying you can't write good code in Webforms but in the books and classes that I seen teach ASP.NET this never seems to be a main focus.
Like for instance I hate the datasource controls I am tutoring some people in WebForms and they love to drag a datasource in and then write their SQL statements in that datasource. Then in the code behind they use these datasorces to insert their records.
So every time they need to make a new SQL query a new datsource is dragged on and made. So now you all your logic is all mixed together. It makes it so much harder to find out whats going on, switch to different things if needed then of course it is limiting.
Something that revolves around the name "controller" can only mean problems.
I tried following the Nerddinner http://www.asp.net/mVC/ tutorial this morning. I'm comfortable in webforms, but nothing in that nerddinner tutorial made sense, just an outdated, hardcoded recipe from mvc1.0 that dosent even compile with the current mvc2.0, probably Wrox made this tutorial, only they can come up with only formating and no content.
I didn't see anything in there that was good; a bunch of hardcoded conventions I didn't need.
I certainly didn't see anything in there that would make me say I'd want to move from webforms, although this seems to be all the propaganda I read.
They put this tutorial based around wizards, on http://www.asp.net/mVC/ main page, while claiming the model is lean, all of it is generated code they don't explain, the default mvc template project has something like 15 references.
This 2 page website managed to be slow to build and to load.
Was 30 minutes in it until I realized my data model didn't match the one from the tutorial and many things that had been generated using the create controller and create view wizards were now failing.
With what I was provided in the rushed tutorial, I wasn't able to recover the project. I'll just pass until I find better documentation.

Is ASP.NET MVC a good platform?

I aim to try use DevExpress web server controls (which are awesome) in an ASP.NET MVC project (some articles I read on 'net seems to indicate the two can work well together).
I'm eager to start a new project using ASP.NET MVC, and I have been reading up a lot on ASP.NET MVC lately, but I'm not sure if I should invest a project in it. My concern is that it may turn out to be like LINQ to SQL, which is essentially been killed off since MS will not be providing updates.
Is ASP.NET MVC a viable solution to invest in my case?
Yes definitely ASP.NET MVC or any other MVC framework is worth learning. MVC pattern is all about seperation of concerns and helps you to keep your code clean.
If you like Devexpress control too much you could be disappointed because there is no server side control in ASP.NET MVC. But if you want to learn Web's underlying mechanism,HTML, Javascript , clean code, TDD ASP.NET MVC is a good way to go.
Learn first, experiment later
Asp.net MVC is a great development platform for building web applications, so it's definitely worth your time to learn it through and through.
But I suggest you first learn MVC framework and build at least one semi complex app with it and then start experimenting with mixing MVC with web forms controls. It is possible but as much you think you will gain you'll probably loose more. So I would be a bit reluctant and advise you not to match these. At least not on a Greenfield project.
In other words: presumably knowing Asp.net web forms would you suggest someone to heavy use dynamicly created user controls in their web pages if they're just about to learn the technology of Asp.net web forms? Probably not. Or mixing web forms with ASP pages on a greenfield project...
Instead try finding great either MVC-friendly server extensions or client-side libraries that will help you create rich web apps like ExtJS (I don't work for ExtJS llc, but I used the lib on a project in the past and liked it a lot). Using something like this you won't loose stuff from MVC and gain great user experience and rich functionality.
Seeing how you're asking the question on this site, I'd say YES!
DevExpress has a bunch of MVC specialized controls, that use Ajax to get data from the server via callbacks. You can see demos of the controls here:
http://mvc.devexpress.com.
I am not sure if you can use the web forms controls, my understanding is that you can't.
Also, regarding LinqToSql, you don't have to use that. I am using NHibernate for the data layer and it works very nice with MVC.
I worked with asp.net and web forms for more than 5 years and at least 1 year with the DevExpress controls for asp.net, but now I love MVC so much that I think I don't want to go back to the web forms anytime soon.
Hope this helped.

Resources