Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gabriele Siculiana 5 posts 75 karma points
    Oct 21, 2018 @ 18:08
    Gabriele Siculiana
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 21, 2018 @ 19:12
    Jan Skovgaard
    0

    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

  • Gabriele Siculiana 5 posts 75 karma points
    Oct 27, 2018 @ 09:41
    Gabriele Siculiana
    0

    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?

  • John Bergman 483 posts 1132 karma points
    Oct 22, 2018 @ 05:27
    John Bergman
    0

    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.

  • Gabriele Siculiana 5 posts 75 karma points
    Oct 27, 2018 @ 10:09
    Gabriele Siculiana
    0

    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)

  • Gabriele Siculiana 5 posts 75 karma points
    Nov 03, 2018 @ 17:07
    Gabriele Siculiana
    0

    Hi, I found the problem... I had forgotten to copy the site DLLs. Thanks again for your availability (i'm a beginner, sorry again).

Please Sign in or register to post replies

Write your reply to:

Draft