简体   繁体   English

Web 请求中的 IIS 和 Visual Studio IIS 有什么区别?

[英]What is the difference between IIS and Visual Studio IIS in Web Requests?

I am trying to run a custom site on IIS with ASP.NET whih connects to a site on the internet which is a coding community via HttpWebRequest.我正在尝试使用 ASP.NET 在 IIS 上运行一个自定义站点,该站点通过 HttpWebRequest 连接到 Internet 上的一个站点,该站点是一个编码社区。

If I use the Visual Studio built-in Development Server it successfully runs and shows the result of the Request.如果我使用 Visual Studio 内置开发服务器,它会成功运行并显示请求的结果。

But as soon as I use the local IIS for running the application I get an error saying that the site (which I am trying to connect to) is refusing the connection.但是,一旦我使用本地 IIS 运行应用程序,我就会收到一条错误消息,指出该站点(我试图连接到的站点)拒绝连接。

But there has nothing changed right?但是什么都没有改变吧? I have not changed my code at all!我根本没有改变我的代码!

EDIT: My understanding is that the IIS and VIsual Studio's "On-The-Run" IIS are in base the same.编辑:我的理解是 IIS 和 VIsual Studio 的“On-The-Run”IIS 基本相同。 But why are they acting so different here?但为什么他们在这里表现得如此不同?

Web applications in a production environment are hosted using Microsoft's IIS web server software.生产环境中的 Web 应用程序使用 Microsoft 的 IIS Web 服务器软件进行托管。 In the development environment, however, the application may be hosted using IIS or the ASP.NET Development Server.但是,在开发环境中,应用程序可能使用 IIS 或 ASP.NET 开发服务器托管。 Ideally, the same web server software should be used in both environments because using different software adds another variable in the mix.理想情况下,应在两种环境中使用相同的 Web 服务器软件,因为使用不同的软件会在混合中添加另一个变量。 However, the ease of use of the ASP.NET Development Server makes it an attractive choice in the development environment.但是,ASP.NET 开发服务器的易用性使其成为开发环境中的一个有吸引力的选择。 The good news is that there are only a few fundamental differences between IIS and the ASP.NET Development Server, and if you are aware of these differences you can take steps to help ensure that the application works and functions the same way regardless of the environment.好消息是 IIS 和 ASP.NET 开发服务器之间只有一些基本差异,如果您了解这些差异,您可以采取措施帮助确保应用程序在任何环境下都能以相同的方式工作和运行.

Visual studio uses IIS Express to host your application, which is a lightweight, self-contained version of IIS. Visual Studio 使用 IIS Express 来托管您的应用程序,它是 IIS 的轻量级、自包含版本。 It is used by developers to develop and test websites inside the same machine(localhost) .开发人员使用它在同一台机器(本地主机)内开发和测试网站 The major difference between IIS and IIS express is that IIS express doesn't accept request outside the localhost. IIS 和 IIS express 之间的主要区别在于 IIS express接受本地主机之外的请求。 while IIS accept the web request from any another machine inside the domain.而 IIS 接受来自域内任何另一台机器的 Web 请求。 SO in order to accept request from your application you have to deploy it to IIS not IIS express.因此,为了接受来自您的应用程序的请求,您必须将其部署到 IIS 而不是 IIS express。

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

相关问题 将Visual Studio 2008 Web应用程序部署到IIS 6的正确过程是什么? - What is the correct procedure to deploy a Visual studio 2008 Web Application to IIS 6 Visual Studio 中的 Web 部署和 FTP 部署有什么区别? - What is the difference between Web deploy and FTP deploy in Visual Studio? Visual Studio 2003和IIS - Visual Studio 2003 and IIS Visual Studio -> 发布到本地文件夹(远程 iis)和排队请求 - Visual studio -> publish to local folder (remote iis) and queuing requests 在Visual Studio中//和///有什么区别? - What is the difference between // and /// in Visual Studio? 在ASP.Net中,IIS和web.config中的身份验证有什么区别 - In ASP.Net what is the difference between Authentication in IIS and in web.config 使用IIS部署我的visual studio Web应用程序 - Deploying my visual studio web application using IIS 将IIS中的现有网站添加到Visual Studio 2017中的Git - Adding existing Web Site in IIS to Git in Visual Studio 2017 将带有WCF库的Web应用程序从Visual Studio开发人员移至IIS - Move web application with WCF library from Visual Studio dev to IIS 未找到 Visual Studio 2019 本地 IIS Web 站点 - Visual Studio 2019 not found local IIS Web Site
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM