Question

I'm new at WCF and i'm trying to create a service, it needs to convert url to server path. For example: Gets -> "www.sample.com/client1" Returns -> "c://samplefolder/sampleproject/client1"

I'm trying this code:

string realPath = HostingEnvironment.MapPath(URL);

but I get The relative virtual path 'http://localhost:5353' is not allowed here

Does anyone knows what i'm doing wrong? Thanks

Was it helpful?

Solution

Try with the relative path. Instead of the url "http://www.sample.com/client1" use "~/client1" (the symbol '~' specifies the root folder of your application)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top