Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have website and inside the project I have xml file that contain xml files
at the run-time every thing works good but when publish my website on IIS the error cannot find xml file :

Part of the exception error
System.IO.FileNotFoundException%3a+Could+not+find+file+%27C%3a%5cdeploy2018%5c20180620%5cdeploy%5cxml+files


to be more clear the xml file exist in the project file on IIS, and Connection string
<add key="XMLPHSPATH" value="http://localhost:8081/xml files" />


Can anyone help me with this issue.

What I have tried:

I Tried to change URL
I Tried to change the permission

nothing works
Posted
Comments
Herman<T>.Instance 20-Jun-18 7:01am    
Has the exception innerexceptions?
Is the path relative or absolute and is it correct?
ZurdoDev 20-Jun-18 8:03am    
Either
1. The path is wrong.
2. The file is not there.
3. Or the account running the IIS Application pool does not have permissions.

All easy things to check.
Member 13866338 20-Jun-18 8:24am    
1. when i open the path URL using the browser it open
2. File is there
3. the user has full permission
ZurdoDev 20-Jun-18 8:30am    
But the path is encoded for urls and won't work using the System.File namespace so maybe you need to Server.UrlDecode(url) it first.

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