Hello,
I've created a simple Controller with Umbraco Web Api. Locally works but when i run the site on server the Controller isn't found.
The site is visible and all contents are shown.
Have you had a look in the /App_Data/Logs folder to see if there is anything in there related to this issue marked with "ERROR"? It might provide you with some more details about the issue making it easier for you to figure out where things maybe go wrong (If an error is in fact happening).
If its in another assembly, are you sure that is getting deployed? I agree with Jan, check the logs, maybe a dependency is missing.
The path shouldn't change, meaning that if it works locally, the only difference between the paths should be the hostname and port number.
There is also a newget package called routdebugger that will give you a diagnostic output of all of the known routes; once installed you can turn it on or off by changing a setting in the web.config.
Hi John and thank you for your fast reply and sorry for my late reply,
controller is inside the controller folder in the root directory.
Controller has this "using":
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Umbraco.Core.Models;
using Umbraco.Web;
using Umbraco.Web.WebApi;
using System.Web;
using System.Web.Http.Results;
using Newtonsoft.Json;
but half of these are not used (I left them there because it was an experimental file and later i will make a deep clean) and i don't remember having installed a library.
The deploy of site it was simply a copy/paste of files that i have created or modified (View, Script, css, Controller and the bundle folder).
I also have another problem:
I have integrated Vue.js (with webpack), when i go to the url http://localhost/Umbraco it doesn't load all the assets because the path of bundle file (./bundle.js) doesn't include the "Umbraco" folder but if I add "/"at the end of the Url it shows all correctly; do you have any idea about it? (I solved in ISS changing the name of folder and the path of application)
Web Api Controller not found
Hello, I've created a simple Controller with Umbraco Web Api. Locally works but when i run the site on server the Controller isn't found. The site is visible and all contents are shown.
Here the urls (local and server)
local: http://localhost:8086/umbraco/api/Home/GetAllProducts
browser on server (the site is inside another folder called Umbraco, the site is visible at http://localhost/Umbraco): http://localhost/Umbraco/umbraco/api/Home/GetAllProducts
Why I can't see the controller on server? I've also tried different path like
Hi Gabriele and welcome to the Umbraco forum :)
Have you had a look in the /App_Data/Logs folder to see if there is anything in there related to this issue marked with "ERROR"? It might provide you with some more details about the issue making it easier for you to figure out where things maybe go wrong (If an error is in fact happening).
Looking forward to hearing from you!
/Jan
Hi Jan and thank you for your fast reply (sorry for my late reply), I've checked the logs but there are no errors... Could it be ISS?
Where is the code for the controller?
If its in another assembly, are you sure that is getting deployed? I agree with Jan, check the logs, maybe a dependency is missing.
The path shouldn't change, meaning that if it works locally, the only difference between the paths should be the hostname and port number.
There is also a newget package called routdebugger that will give you a diagnostic output of all of the known routes; once installed you can turn it on or off by changing a setting in the web.config.
Hi John and thank you for your fast reply and sorry for my late reply, controller is inside the controller folder in the root directory. Controller has this "using":
but half of these are not used (I left them there because it was an experimental file and later i will make a deep clean) and i don't remember having installed a library.
The deploy of site it was simply a copy/paste of files that i have created or modified (View, Script, css, Controller and the bundle folder).
I also have another problem: I have integrated Vue.js (with webpack), when i go to the url http://localhost/Umbraco it doesn't load all the assets because the path of bundle file (./bundle.js) doesn't include the "Umbraco" folder but if I add "/"at the end of the Url it shows all correctly; do you have any idea about it? (I solved in ISS changing the name of folder and the path of application)
Hi, I found the problem... I had forgotten to copy the site DLLs. Thanks again for your availability (i'm a beginner, sorry again).
is working on a reply...