Asp – Use ASP MVC inside an ASP.Net WebForms Applications (Using 2 different programming languages!)

asp.net-mvc

We'd like to use the ASP.Net MVC Framework to extend (and gradually convert) an existing ASP.Net Webforms application which we've "inherited". I know that we can add MVC into a Webforms project, but the existing project is written in VB.Net and we would much prefer to use C# going forward.

Our ideal solution is to be able to add Controllers written using C# and Views also using C#, but I'm not sure that's possible.

Does anyone have any ideas how we could achieve this hybrid of languages as well as frameworks?

Best Answer

Combining Webforms with MVC

That's quite easily possible but almost everyone would probably try to convince you not to do it because sooner or later you'll end up in a messier place that you'll hard get out of...

Combining C# with VB.net

This one will be tougher. In case you have a Asp.net web site Project set up it's practically possible to make any kind of language combination. But combining this with MVC I don't think that would be a very wise idea.
But in case you have a Web Application Project so far (see the comparison) I don't think you'll be able to combine C# with VB.Net in a maintainable way (or maybe not in any way). At least you won't be able to put C# code inside Controller folder within your web project because you can't mix language in a single assembly.

Tough luck huh?