Cannot get surface controller to find template on server
I am attempting to develop a simple contact form for a client. Following instructions in the documentation, I created a ViewModel, Surface Controller, and View of a simple form and tested it on my local development machine. It works fine there.
However, when I moved all of this to the production server, I continue to get "No physical template file was found for template Index" message.
Short of building a custom router, I've tried everything I know to try, including rebuilding the template on the production server, moving the template to various locations under Views, etc.
Why would there be a difference between my machine and the production server? Shouldn't it work the same?
Dennis, thanks for pointing to the obvious - I uploaded the updated project .dll files and it worked! Sometimes, when looking at trees, it takes someone else to point out you're in a forest. Thank you!
When you build your solution locally, all your custom .cs files such as your controllers, are compiled into .dll files and located in the /bin folder. If you haven't deployed your .dll files to the production server, that would explain why your controller doesn't get routed on the production server but works locally.
Deploy your .dll files, especially the one with the same name as your UmbracoSite, example: MyWebsite.dll.
Cannot get surface controller to find template on server
I am attempting to develop a simple contact form for a client. Following instructions in the documentation, I created a ViewModel, Surface Controller, and View of a simple form and tested it on my local development machine. It works fine there.
However, when I moved all of this to the production server, I continue to get "No physical template file was found for template Index" message.
Short of building a custom router, I've tried everything I know to try, including rebuilding the template on the production server, moving the template to various locations under Views, etc.
Why would there be a difference between my machine and the production server? Shouldn't it work the same?
Hi hrcodenstuff.
Could you please paste in your controller, viewmodel and view code?
Also, have you deployed your .dll files in the bin folder, and not just the view?
What .dll files?
Dennis, thanks for pointing to the obvious - I uploaded the updated project .dll files and it worked! Sometimes, when looking at trees, it takes someone else to point out you're in a forest. Thank you!
Awesome, happy it works for you!! Have a great weekend!!
When you build your solution locally, all your custom .cs files such as your controllers, are compiled into .dll files and located in the /bin folder. If you haven't deployed your .dll files to the production server, that would explain why your controller doesn't get routed on the production server but works locally.
Deploy your .dll files, especially the one with the same name as your UmbracoSite, example: MyWebsite.dll.
is working on a reply...