在与ASP.Net应用程序相同的端口上启动.Net Web服务 [英] Starting .Net web service on the same port as the ASP.Net application

查看:134
本文介绍了在与ASP.Net应用程序相同的端口上启动.Net Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个简单的Visual Studio解决方案,其中包含2个项目:

We have a simple Visual Studio solution containing 2 projects:


  • A。)简单的ASP.Net网站

  • B。)托管在另一个ASP.Net应用程序中的RESTful Web服务

我们只想在Debug中启动项目模式(F5)并让A通过Ajax从B消耗数据。我们无法在所有开发计算机上配置IIS(因为其中一些在客户端)。问题可能是JavaScript需要与其发布到的URL在同一个域中。

We want to simply start the projects in Debug mode (F5) and have A consume data from B through Ajax. We do not have the possibility to configure IIS on all development machines (because some of them are on the client's side). The problem might be that JavaScript needs to be in the same domain as the URL it posts to.

有什么方法可以使用Visual Studio 2010开发服务器在同一端口上以调试模式同时启动两个应用程序?

Is there any way we can use Visual Studio 2010 Development Server to start both applications simultaneously in debug mode on the same port?

如果这不可能,那么您可以推荐的下一个最佳选择是什么?

If this is not possible, what is the next best thing you can recommend?

推荐答案

我们解决了这个问题通过在开发工作站上安装IIS。
在每个Visual Studio项目的 Web属性页上,选择使用本地IIS Web服务器。
不要选中使用IIS Express。项目URL将设置为http:localhost /< projectname> (注意:在同一个域中)。系统将提示您为每个目录创建一个虚拟目录。每个都将分配给默认的IIS应用程序池。打开Internet信息服务(IIS)管理器。单击左窗格上的应用程序池。在右窗格上,添加另一个集成的应用程序池。对于其中一个应用程序,打开高级设置...。在属性视图中,选择刚创建的应用程序池作为应用程序池。这些应用程序应该是可并行调试的,因为每个应用程序池都会产生一个新的操作系统进程,可以在该进程上附加一个单独的调试器。

We solved this problem by installing IIS on the development workstation. In each Visual Studio project, on the Web property page, select Use Local IIS Web server. Do not check Use IIS Express. The Project URLs will be set to http:localhost/<projectname> (note: in the same domain). You’ll be prompted to Create a Virtual Directory for each. Each will be assigned to the default IIS app pool. Open the Internet Information Services (IIS) Manager. Click Application Pools on the left pane. On the right pane add another integrated application pool. For one of the applications, open the Advanced Settings... In the properties view select the app pool you just created as the application pool. The applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.

这篇关于在与ASP.Net应用程序相同的端口上启动.Net Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆