locked
ASP.Net Web API RRS feed

  • Question

  • User686683308 posted

    Dear all experts 
    When i run my controller => https://localhost:44306/api/Default in asp.net web api it doesn't show anything show in browser just show 

    This site can’t be reached

    but when i try to create other asp.net web api it shows as normal with its default values, so can any tell me what is the problem ?

    Thanks in advance !

    Thursday, December 13, 2018 6:32 AM

All replies

  • User753101303 posted

    Hi,

    It is really named DefaultController ? It's unclear if you meant that you have another controller in the same web api project that works or if you mean that you have another web api projects that works.

    You could also perhaps place a test.htm file at the root and see if it works (in short I'm trying to understand if this is a problem with just a controller or if you can't reach anything on this site not even an HTML page).

    Thursday, December 13, 2018 3:19 PM
  • User61956409 posted

    Hi UnVandy,

    Firstly, as PatriceSc mentioned, please make sure if your controller named DefaultController. And if possible, please share the code of your DefaultController.

    Secondly, you can try to add another empty Web API controller, and simply implement controller action, like below. And then test if you can access that new one.

    public class YourControllerNameController : ApiController
    {
        public string Get()
        {
            return "Test Value";
        }
    }

    With Regards,

    Fei Han

    Friday, December 14, 2018 2:14 AM