How to change the URL of a Webservice in VS2017


I have got a ASP.NET web site project in VS2012. When I debug it with VS2012, it starts as http://localhost:51510/VAWebService/Services.asmx.

With VS2012, the port 51510 and the path VAWebService is set in the .sln file, Keys VWDPort and VirtualPath.

I have to port this to VS2017. I can open the sln in VS2017 and all seems to work, but when I start to debug it, it starts under http://localhost:51510/Services.asmx

The VAWebService is lacking in the URL.

I've tried to change stuff in the .vs/config/applicationhost.config file, like it is described there: How to change website URL in Visual Studio 2015

The file applicationhost.config has been created by VS2017 alone. In this file, under sites, there are 2 sites mentioned. One which is called WebSite1 and has nothing to do with my stuff and one which is called VAWebService.

Under bindings there is the entry bindingInformation="*:51510:localhost", so this refers to my site. And obviouosly, VS has taken the port 51510 from the sln file. But it has not taken the VirtualPath.

Now I exit VS2017, make sure that no iisexpress is running anymore and in the applicationhost.config I change the line

    <virtualDirectory path="/" physicalPath="C:\branches\Trunk\VAServer\VAWebService" />
    <virtualDirectory path="/VAWebService" physicalPath="C:\branches\Trunk\VAServer\VAWebService" />   

I reopen the sln. The first thing I notice is that on the properties of the web site, the URL still is http://localhost:51510. It is grey and I cannot change it.

When I rebuild all and start to debug, I get an error message in german,
I've translated it here, via DeepL:

HTTP ERROR 500.19. The requested page cannot be accessed because the associated configuration data is invalid for the page.

Detailed Error Information:

Modules IIS Web Core

Notification: BeginRequest

Handler: Not yet defined

Error code: 0x8007000d

Configuration error: A matching virtual directory could not be found

Configuration file:

Requested URL: http://localhost:51510/Service.asmx

Physical path:

Logon Method: Not yet defined

Logon User Not: defined yet

Trace directory C:\Users....\IISExpress\TraceLogFiles\VAWEBSERVICE

Configuration source: -1: 0:

More Info.

When I click "More Info", that page says that 0x8007000d is caused by a malformed xml element in the Web.config or the Applicationhost.config file.

I don't know what to do anymore. How can I get this page to start as

http://localhost:51510/VAWebService/Services.asmx ??
asked on Stack Overflow Aug 7, 2019 by AndreasW

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0