Answered by:
IIS Relative Paths

Question
-
Hi. I have an ASP.Net application with JavaScript that we're testing using the local IIS web server option (http://localhost/application) on two development PCs that are set up the same (not identical as we didn't use an image tool) with the same version of VS 2012 and IIS 6.1.
Within the application we use an Ajax call to a web method in an asmx file. On one PC this call requires the application name in the url path (i.e. /application/Documents/Actions.asmx/Method) and on the other it requires a url without the application name (i.e. /Documents/Actions.asmx/Method) and neither works on the other machine. This means we can't run the same code on the two PCs.
Any ideas about why one PC requires the root name and the other doesn't? Maybe a setting in IIS?
Thanks
Neil
- Moved by Jack Zhai-MSFTMicrosoft contingent staff Tuesday, September 2, 2014 1:51 AM The ASP.NET issue.
Tuesday, August 26, 2014 12:44 PM
Answers
-
Hi Neil,
Actually this forum is to discuss the VS usage issue, if this issue is related to the ASP.net, you could ask this question in the ASP.NET forum: http://forums.asp.net. If then, you could get an answer more quickly and professional. Thanks for your cooperation.
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.
- Proposed as answer by Just Karl Friday, September 12, 2014 3:03 PM
- Marked as answer by Dave PatrickMVP Monday, September 15, 2014 2:09 AM
Wednesday, August 27, 2014 11:46 AM
All replies
-
Hi Neil,
Actually this forum is to discuss the VS usage issue, if this issue is related to the ASP.net, you could ask this question in the ASP.NET forum: http://forums.asp.net. If then, you could get an answer more quickly and professional. Thanks for your cooperation.
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.
- Proposed as answer by Just Karl Friday, September 12, 2014 3:03 PM
- Marked as answer by Dave PatrickMVP Monday, September 15, 2014 2:09 AM
Wednesday, August 27, 2014 11:46 AM -
Hi,
You need to use the relative path for sure, you might use different environment for your deployments like Dev, QA, USER and prod so relative path is only option you code can be promoted in all the environment and working correctly.
Cheers, Senthilraj
Wednesday, August 27, 2014 1:11 PM -
HI,
I think you minunderstand the problem. I'm using a path to identify the root, but in one VS environment it requires the application name at the start (e.g. \application\url\method) and in the other it doesn't (i.e. \url\method). Both are using the local IIS Server option under properties/web.
Neil
PN
Wednesday, August 27, 2014 1:22 PM -
Hi,
Are you programmatically accessing this property?
What property you are using to access the file?
Is it possible to use different property than what you are currently using?
Cheers, Senthilraj
Wednesday, August 27, 2014 1:36 PM -
Hi,
Here's an example:
window.open('/VIEWit6/Documents/Download.aspx' + queryString, '_self');
On one PC the url path requires a suffix of /VIEWit6 (the application name) to refer to the root folder (as above) and on another it doesn't:
window.open(/Documents/Download.aspx' + queryString, '_self');
And both PCs are set up the same and both are using IIS (as described above) as the development host, and each way of defining the root doesn't work on the other PC.
Neil
PN
Wednesday, August 27, 2014 1:49 PM -
This has been resolved in the asps.net forum: http://forums.asp.net/p/2005115/5765323.aspx?p=True&t=635447349531809531&pagenum=1
But its only a workaround and doesn't explain why IIS on two different PCs require different urls...
PN
Wednesday, August 27, 2014 3:20 PM