简体   繁体   English

发布后Web应用程序不起作用

[英]Web Application doesn't work after publish

I have create a web application. 我已经创建了一个Web应用程序。 Also I create a controller named person, when I'm deploy my project and running example http://localhost:1392/api/Person 当我部署项目并运行示例http://localhost:1392/api/Person时,我还会创建一个名为person的控制器。

I'm getting return value from controller. 我正在从控制器获取返回值。

public IEnumerable<string> Get()
{
    return new string[] { "value1", "value2" };
}

// GET: api/Person/5
public string Get(int id)
{
    return "value";
}

// POST: api/Person
public void Post([FromBody]string value)
{
}

// PUT: api/Person/5
public void Put(int id, [FromBody]string value)
{
}

// DELETE: api/Person/5
public void Delete(int id)
{
}

When I'm publish my web application example in path C:/www 当我在路径C:/ www中发布我的Web应用程序示例时

And trying to host this folder from iis7 I can't use above URL. 并尝试从iis7托管此文件夹,我无法使用上述URL。 I'm getting error 404 Not found " http://192.168.0.214:8081/api/Person " 我收到错误404找不到“ http://192.168.0.214:8081/api/Person

IIS7 Image: IIS7图片:
IIS7图像

And here is my error 这是我的错误

Image error: 图片错误:
图片错误

Your url is incorrect 您的网址不正确

Change 更改

http://192.168.0.214:8081/api/Person

To

http://192.168.0.214:8081/FirstWebPage/api/Person

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM