The system cannot find the path specified

I ran across this and thought I'd share in case anyone out there hits the same issue.  If you see this error pop up in the IIS7 Administration tool (IIS Manager - inetmgr.exe) that looks like this:

The system cannot find the path specified.  (Exception from HRESULT: 0x80070003)"

It may be caused by an invalid path, including using the "/" instead of the "\".  When you enter physical paths in the IIS Administration tool, please remember to enter C:\path instead of C:/path or you will see this error. 

One other tip when it comes to using physical file/dir paths on IIS7: don't forget you can now use environment variables! 

%systemdrive%\path\foo is much better than C:\path\foo, because it is transportable across machines even where the system-drive is not the same.  You may want to consider creating your own %webroot% variable on every machine, so you can easily tweak the physical location of your config/content without touching configuration. 

IIS sets all physical paths using environment variables by default.  Don't muck it up by using hard coded paths, you'll regret it later! ;)

1 Comment

Comments have been disabled for this content.