Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate MVC in WebForms

According http://www.codeproject.com/Articles/38778/ASP-NET-WebForms-and-ASP-NET-MVC-in-Harmony

I did this changes to my WebForms project:

  1. Added System.Web.Mvc.dll
  2. Added System.Web.Abstractions.dll
  3. Created Controllers and View folder
  4. Added those assemblies in my debug section
  5. Added MVC, MVC.Ajax, MVC.HTML to my pages->namespaces
  6. Added Web.Routing.UrlRoutingModule as HttpModule
  7. Registered test route

But on "Getting Visual Studio to Offer MVC Items" section i dont have Unload Project Option and also i dont have csproj file. I only have .sln and .sln.DotSettings.user

I can add view but not controller, why, any suggestion? http://prntscr.com/94imo

like image 401
Novkovski Stevo Bato Avatar asked Sep 10 '26 06:09

Novkovski Stevo Bato


1 Answers

Since you wrote that you don't have a csproj file I'm guessing that what you have is a WebForms Website not a WebApplication project.

I took a quick look at the tutorial you posted a link to and it seems that it isn't mentioning that step but when I was last transforming a WebForms Website into an MVC WebApplication (admittedly it was a while ago) I had to convert it to a WebForms WebApplication project first.

like image 184
Paweł Sokołowski Avatar answered Sep 12 '26 23:09

Paweł Sokołowski