Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a web service project A in a solution "TestSolution" and A.FileConverter() is the service method.

FileConverter(string Url)
{
Uri myUri = new Uri(Url);
string path = Server.Mappath(myUri.AbsoluteUrl);
}


If I am calling this service from another project (say B) in the same solution, is there any way that the Server.Mappath() will return path of the project B?

Now if I have created an instance of the service class, it is always referring to the relative path of the web service project and not to the project from which it is called
Posted

1 solution

No. The web service is in a separate web application and as such Server.MapPath is relative it's space not to the callers.
 
Share this answer
 
Comments
dotdeveloper2008 30-Jun-11 13:07pm    
Thanks for your comments. Is there any otherway other than Server.Mapping to get the caller path?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900