Last post Sep 18, 2017 08:52 AM by AngelinaJolie
Sep 15, 2017 07:31 AM|f.a.rodriguez|LINK
I'm a newbie when it comes to web hosting/deployment, and I'm trying to understand something about that. I have developed a very basic Web API and Web App in ASP .Net Core 2.0. I would like to upload both of these to my web server (a very basic shared hosting
Windows server with a company called HostKing). I would like to copy the Web API to a folder called 'api' and the Web App to a folder called 'app'. So, one would go to httpdocs/api and the other to httpdocs/app. If I publish the API to httpdocs,
it works and I can access just fine. For example, I can call the "values" endpoint via a GET request to www.mydomain.com/api/values. But if I publish it to httpdocs/api, then I get a 404 - File or directory not found. when
I'm not very clued up about deployment/hosting, but I read that you cannot just create directories and expect them to work - you have to create a "virtual directory" in IIS and map it to a physical directory? So I created a virtual directory called api in
my Plesk control panel, but I still cannot access my API. I'm obviously doing something wrong, but being so ignorant in this, I cannot figure out what it is.
P.s. I copied an image into the httpdocs/api directory, and this I can access (via
The root web.config (in httpdocs) looks like this:
<?xml version="1.0" encoding="utf-8"?>
<add name="aspNetCore" path="C:\Websites\eball.co.za\httpdocs" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
<aspNetCore processPath="dotnet" arguments=".\eBall.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
I have no other we.config files anywhere other than this root one.
Any ideas anyone? Thank you...
Sep 18, 2017 08:52 AM|AngelinaJolie|LINK
I read that you cannot just create directories and expect them to work - you have to create a "virtual directory" in IIS and map it to a physical directory
Yes,as far as I know ,if you want to run different applications in a site , you need to add another site in current site .
if you have created a virtual directory , you could covert current virtual directory to
Application directly, right-click your virtual directory application and choose
Covert to application .
Then choose sub application and click browser ;