如何在IIS 10上承载ASP.NET Web API 2项目(How to host ASP.NET Web API 2 project on IIS 10)

编程入门 行业动态 更新时间:2024-10-28 18:25:16
如何在IIS 10上承载ASP.NET Web API 2项目(How to host ASP.NET Web API 2 project on IIS 10)

我正在尝试在IIS 10上托管一个ASP.NET Web API 2项目,并且我不断收到一个页面,指出找不到Service Endpoint。

我用于测试的项目是ASP.NETApp API入门示例ProductsApp项目2 。 如果我在调试中运行该项目,那么该页面按预期方式显示,而通过本地主机上的VS2012 IIS express进行托管时:54170

然后我发布该项目使用VS2012文件。

发布到文件后,我在localhost:8080上的IIS 10上创建了一个新站点,并将物理路径指向我发布ProductsApp项目的文件夹。

在这一点上,如果我去浏览网站,它会出现一个页面,它所说的是没有找到服务端点。

我已将DefaultAppPool身份更改为LocalSystem,因此我认为这不是一个权限问题。

当我从VS2012进行调试时,如何让网站显示出来,但是从IIS 10开始?

I am trying to host an ASP.NET Web API 2 project on IIS 10, and I keep getting a page saying Service Endpoint not found.

The project I am using for testing is the sample ProductsApp project here Getting Started with ASP.NET Web API 2. If I run the project in debug, then the page shows up as expected while it is being hosted through VS2012 IIS express at localhost:54170

I am then publishing that project to file using VS2012.

After publishing to file, then I made a new site on IIS 10 at localhost:8080 and point the physical path to the folder that I published the ProductsApp project to.

At this point if I go to browse the site it comes up with a page that all it says is Service Endpoint not found.

I've changed my DefaultAppPool Identity to LocalSystem, so I don't think it's a permissions issue.

How do I get the site to show up like it does when I'm debugging from VS2012, but from IIS 10?

最满意答案

我昨天浪费了很多时间试图弄清楚这一点,但今天早上有一个小小的摆弄,我找到了我的答案,我很惊讶,我没有找到我看到的其他地方。

为了解决我的问题,我只需要做这件事。

我不需要将ASP.NET内容作为自己的站点托管,而只需要将应用程序添加到默认网站,其物理路径指向从VS2012发布的文件夹。

这显然是我第一次使用ASP.NET,所以我没有安装IIS中的任何ASP.NET功能。 我去打开或关闭Windows功能 - > Internet信息服务 - >万维网服务 - >应用程序开发功能,然后选择所有的ASP文件夹(ASP,ASP.NET 3.5,ASP.NET 4.6)。 编辑: 回顾一下,所有需要的是打开ASP.NET 4.6功能。 当时我不知道我在找什么,所以我试图通过在名称中安装带有“ASP”的所有东西来解决问题。

DefaultAppPool标识不需要更改为LocalSystem,因此我将其更改回ApplicationPoolIdentity。

现在,我的ASP.NET网站已经启动并运行在我的本地主机上了。

I wasted so much time yesterday trying to figure this out, but this morning with a little fiddling I found my answer which I'm surprised I wasn't able to find anywhere else I looked.

To fix my problem this is all I had to do.

Instead of hosting the ASP.NET content as its own site I just needed to add an application to my default web site with the physical path pointing to the folder that was published from VS2012.

This is obviously my first time using ASP.NET, so I didn't have any of the ASP.NET features installed in IIS. I went to Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Application Development Features, then selected all of the ASP folders (ASP, ASP.NET 3.5, ASP.NET 4.6). Edit: Looking back at this, all that was required was turning on the feature ASP.NET 4.6. At the time I didn't know what I was looking for, so I tried to nuke the problem by installing everything with "ASP" in the name.

The DefaultAppPool Identity didn't need to change to LocalSystem, so I changed it back to ApplicationPoolIdentity.

Now I have the ASP.NET site up and running on my localhost.

更多推荐

本文发布于:2023-08-07 10:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463299.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   如何在   ASP   NET   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!