• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

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?
0
pureauto
Asked:
pureauto
  • 5
  • 2
1 Solution
 
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
 
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
pureautoAuthor 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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now