我有一个 ASP.NET 网站和一个 Windows 窗体应用程序。
我的网络服务的位置是:http://localhost:12312/MyWebSiteFolder/WSFile.asmx
问题是:端口号不断变化,如果我重新打开解决方案,它会更改为其他内容:
http://localhost:11122/MyWebSiteFolder/WSFile.asmx
有没有办法让我每次重新打开网站的解决方案时都不必更新 Windows 窗体应用程序中的文件位置?
(假设使用 Visual Studio 2010)
Under the Web tab of the properties for the project, change the "Auto-assign Port" option to "Specific port" and enter the port you want to always use.
或者,如果可能,您可以选择使用本地 IIS 服务器的选项。
Update:
If you're using a "Web Site" project instead of "Web Application," the setting is located in the properties window of the project instead of the properties dialog. Note the "Use dynamic ports" option here:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)