Why are my web services not visible within a virtual directory?

I have an ASP.NET project that has several web services which are called from javascript files in the same project.  The code behind for the services is in the appcode folder of the project and the .svc files are in the same folder as the javascript which calls them.

I have created an install that creates a website and a virtual directory.  If I browse to the page that uses the web service using the virtual directory, the web service call fails.  However, if I set the home directory of the website to the same physical directory as the virtual directory, then browse to the page using the home directory of the website, the web services work.

So, for example, if I use the following address the web services fail:
http://localhost/VirDir/myFolder/page.aspx
If I assign the home folder of the website to match the target of the virtual directory, it works:
http://localhost/myFolder/page.aspx

Any ideas?
pureautoAsked:
Who is Participating?
 
pureautoConnect With a Mentor Author Commented:
I have found that if I run the precompilation utility in Visual Studio 2008  rather than from the comand line, the precompiled web service runs great under a virtual directory.

Old way:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_compiler -p "<filepath>" -v / "<destination>"

New way:
In Visual Studio:
Build --> Publish Web Site --> uncheck "Allow this precompiled site to be updateable"
0
 
Praveen DMInfra Team LeadCommented:
Does it happen even after enabling this option in IIS for the site and the VD..

http://3.bp.blogspot.com/_r-ZWO9cNYNA/R7tnFwkuYpI/AAAAAAAAABs/J03sbY6DPl8/s400/Enable+parent+paths.jpg
0
 
pureautoAuthor Commented:
Yes.  I enabled parent paths on both the website and the virtual directory and the problem remains.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
pureautoAuthor Commented:
I have noticed that the application "starting point" differs between the website and virtual directory.  Could that be the reason that the website path works and the path using the virtual directory does not?  Is there a way to change the starting point for the virtual directory?
0
 
Praveen DMInfra Team LeadCommented:
IIS 6 can have multiple sites created and ...

As u said..try to create or map that virtual directory as with the desired link path and u will be access them accordinglly...
0
 
pureautoAuthor Commented:
Does anyone know how to do that?
0
 
pureautoAuthor Commented:
I have discovered the cause of the problem.  I was running precompiled code.  After deploying the regular source code to the server, the problem clear up.  Now the question changes: Why would a precompiled web service not work inside a virtual directory?

 I used the following command to precompile:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_compiler -p "<filepath>" -v / "<destination>"

 It may be worth noting that this application runs on the .NET 3.5 framework and I notice that the precompiler seems to be for asp.net 2.0.

 

Does anyone know why a precomplield web service would not work inside a virtual directory?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.