문제

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

도움이 되었습니까?

해결책

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top