문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top