Question

We have a large WebForms website (not web project) and we are adding several MVC pages. Initially we placed Controllers and ViewModels/InputModels in the App_Code folder. After working with the setup for a few days, we decided that this would be hard to maintain and reuse in the future, so we decided to move the Controllers and Models in to thier own class library.

I was wondering if it is possible to have the MVC tooling support (like Right-Click-> Add... -> Controller... and such) in a class library project.

I did a little searching and found several solutions talking about project type GUIDs and such, but I see that for MVC >5 there is no special project type any more.

What is the alternative (if one even exists) for getting the tooling support in a class library?

Was it helpful?

Solution

It is better to create the class library as an MVC project (even though it will never be deployed standalone) in order to have the tooling support.

Edit: There are some workarounds such as Razor intellisense from a fake web.config etc, but I've found all of these lacking when compared to full support.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top