How is your project setup? Do you have the VS solution at the same level as your Umbraco website? If so do you then use XCOPY to copy over the DLL's to the /bin folder when you build? I suspect that the assemblies are missing for some reason.
i had named my controller MySurfaceController (and inheirted form umbraco.web.mvc.surface controller); however the url i was using to attempt to access it was
/umbraco/surface/My/
and / or
/umbraco/surface/MySurfaceController/
however it would be appear that the adive that the controller needs to be suffixed SurfaceController is out of date, when i used the url
/umbraco/surface/MySurface/
it worked...
so from my experience you do not need to suffix with SurfaceController for it to be routed properly however as per asp.net mvc convention it does need to be suffixed with Controller.
the app_code part was a red herring and i have now deleted that folder from my solution as it is not required within a web application.
Hope this helps someone else.
I am sure the Umbraco Videos site would provide up to date documentation on V7, however although i have purchased a subscription, i cannot login and support have not responded to me yet.
Can't pick up surface controller in class library
Hello,
I have a fresh Umbraco install (not from nuget).
I have created a class library with a surface controller and referenced to it from my Umbraco project.
My surface controller currently just has one method:
I am browsing to my Umbraco instance at : http://localhost/umbraco/surface/PostALetter/Post but I am getting a 404
Is there anyway to debug if my class library is being picked up by umbraco correctly?
Thanks, Sam
Hi Sam and welcome to our :)
How is your project setup? Do you have the VS solution at the same level as your Umbraco website? If so do you then use XCOPY to copy over the DLL's to the /bin folder when you build? I suspect that the assemblies are missing for some reason.
Looking forward to hearing from you.
/Jan
Hi there,
I have a similar problem on fresh empty asp.net 4.5 web application and nuget umbraco install (7.2.2)
However I have the controller class in the root of the umbraco directory in a Controllers folder.
When I try and access it i get a 404 error.
However if i move it into the app_code folder, i get the following exception...
------------------------------------------------------------------------------------------------
A route named 'umbraco-surface-MySurface
is already in the route collection. Route names must be unique.
Parameter name: name
--------------------------------------------------------
I managed to figure out the issue myself.
i had named my controller MySurfaceController (and inheirted form umbraco.web.mvc.surface controller); however the url i was using to attempt to access it was
/umbraco/surface/My/
and / or
/umbraco/surface/MySurfaceController/
however it would be appear that the adive that the controller needs to be suffixed SurfaceController is out of date, when i used the url
/umbraco/surface/MySurface/
it worked...
so from my experience you do not need to suffix with SurfaceController for it to be routed properly however as per asp.net mvc convention it does need to be suffixed with Controller.
the app_code part was a red herring and i have now deleted that folder from my solution as it is not required within a web application.
Hope this helps someone else.
I am sure the Umbraco Videos site would provide up to date documentation on V7, however although i have purchased a subscription, i cannot login and support have not responded to me yet.
thanks,
Steve
Steve
Thanks Steve, that was it :)
is working on a reply...