Yes, you can create your controllers in a library project rather than the main Umbraco one if you wish.
I would add a new class library (.net framework) project to my solution, and then if you install the Umbraco.Core package via NuGet into that class library then you can create your controller there and still have access to all the Umbraco base classes.
install-package UmbracoCms.Core -version 7.15.3
(for Umbraco 8 you will probably need to install the Umbraco.Web project as this has most of the front end stuff in it)
just remember to add your class library as a reference to your web project so the DLL gets copied over at build time*
*because I would never forget to do that, oh no not me.
Possible to separate the Controller from an Umbraco site?
Usually i would create a Controller under the controller folder.
Is there a recommended way to have this reside in a Class Library rather than the Umbraco project?
Hi J
Yes, you can create your controllers in a library project rather than the main Umbraco one if you wish.
I would add a new class library (.net framework) project to my solution, and then if you install the
Umbraco.Core
package via NuGet into that class library then you can create your controller there and still have access to all the Umbraco base classes.(for Umbraco 8 you will probably need to install the
Umbraco.Web
project as this has most of the front end stuff in it)just remember to add your class library as a reference to your web project so the DLL gets copied over at build time*
*because I would never forget to do that, oh no not me.
is working on a reply...