-2

How can i use different controllers(MVC feat API) from different project(Project Only for MVC Controllers and another only for API Controllers) in one Main Project( on one localhost) ?

4

1 回答 1

1

If you are talking about ASP.NET MVC applications (which is not very clear from your question) you could reference the assemblies containing those controllers in a single ASP.NET MVC application and use them as normal controllers. One possibility is to have all the ASP.NET MVC applications in a single Visual Studio solution where you would reference them in the target application or reference the compiled assemblies from some location.

Of course with this you will also need to copy the corresponding view to the ~/Views folder of the target application otherwise they might not be resolved. There are some techniques that allow you to reuse ASP.NET MVC views across different applications such as the Razor Generator package.

于 2013-03-17T12:32:42.840 回答