locked
How Publish my Web API in the server ??? RRS feed

  • Question

  • User-722270328 posted

    I´m using the Visual Studio 2015 and a solution Web API to be publish in the server...

    My solution do references the DNX 4.5.1.

    Solution DNX SDK version: 1.0.0-rc1-update1

    It return the data by Json Schema

    In the Visual Studio 2015 in my machine it work in the Start Debugging...

    http://localhost:53254/api/retorna_alunos/Geral

    But when I try to publish it by the option Publish, Custom Profile and File System it create 3 folders:

    /approot

    /logs

    /wwwroot

    I copy the 3 folders to the server an try open it the browser:

    http://www.mysite.com/api/retorna_alunos/Geral

    And have the answer:

    Http Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporalily unavailable...

    Where I have the put the folders in the server the internet ?

    /approot

    /logs

    /wwwroot

    What config have to do in the server the internet ?

    Before the published I change the file launchSettings.json:

    {   "iisSettings": {     "windowsAuthentication": true,     "anonymousAuthentication": false,     "iisExpress": {       "applicationUrl": "http://www.mysite.com/",       "sslPort": 0     }   },   "profiles": {     "IIS Express": {       "commandName": "IISExpress",       "launchBrowser": true,       "launchUrl": "api/retorna_alunos/Geral",       "environmentVariables": {         "Hosting:Environment": "Development"       }     },     "web": {       "commandName": "web",       "environmentVariables": {         "Hosting:Environment": "Development"       }     }   } }

    Before it was:

    {   "iisSettings": {     "windowsAuthentication": true,     "anonymousAuthentication": false,     "iisExpress": {       "applicationUrl": "http://localhost:53254/",       "sslPort": 0     }   },   "profiles": {     "IIS Express": {       "commandName": "IISExpress",       "launchBrowser": true,       "launchUrl": "api/retorna_alunos/Geral",       "environmentVariables": {         "Hosting:Environment": "Development"       }     },     "web": {       "commandName": "web",       "environmentVariables": {         "Hosting:Environment": "Development"       }     }   } }

    Thursday, April 20, 2017 2:35 AM

All replies

  • User-2057865890 posted

    Hi rogerio.ricardo,

    To publish Web API, see Set up a hosting environment for ASP.NET Core on Windows with IIS, and deploy to it. Set its Physical path to wwwroot (not approot!) subfolder inside the publish folder.

    Deploying ASP.NET Core RC1 Application to IIS
    http://www.damirscorner.com/blog/posts/20160214-DeployingAspNetCoreRc1ApplicationToIis.html 

    Best Regards,

    Chris

    Thursday, April 20, 2017 9:50 AM
  • User-722270328 posted

    Excuse me, I still can not to publish my Web API in the server...

    I have no access in the server and also the IIS...Only FTP...I depend the Server Administrator for this...

    I can only copy the files to the server...

    About the question:

    "Set its Physical path to wwwroot (not approot!) subfolder inside the publish folder."

    I have to copy the files from folder /approot (published by Visual Studio) to the folder in the my application (mysite - root) the

    server. Only that ?

    Or have to create a subfolder /api in it (root) ? And copy to this folder (api) ?

    For my part, would that be it ?  The rest would be Server Configuration by the Server Administrator...

    To call the api I will go to do:

    http://www.mysite.com/api/retorna_alunos/Geral

    Friday, April 21, 2017 1:32 PM
  • User-2057865890 posted

    Hi rogerio.ricardo,

    I have no access in the server and also the IIS...Only FTP...I depend the Server Administrator for this...

    I can only copy the files to the server...

    Upload these two folders approot and wwwroot to your hosting account. The rest would be Server Configuration by the Server Administrator. You could refer Publishing an ASP.NET 5 (vNext) Application.

    Best Regards,

    Chris

    Tuesday, April 25, 2017 7:36 AM