Deployment URI Format

Topics: DocSites, General Questions
Dec 2, 2008 at 9:46 AM
Hi all,

I'm having trouble getting the URI format correct for the Target Location property of the DocProject Deployment property grid.

We have a server on the intranet that is going to host the DocSite, but setting the Target Location to be in the format "//server/folder/" results in an InvalidURIException. Using a mapped network drive gets around the problem for now, but we're planning on producing quite a few more DocSites and don't want to have to map a drive on our build machine to each of the website folders.

Any ideas?
Coordinator
Dec 2, 2008 at 11:55 AM
Hi,

I was able to reproduce the problem so I'll create a work item.  Thanks for reporting this.

Cause:
It seems that the System.Uri class (which DocProject uses to format the target path) does not include the server name in its AbsolutePath property when a UNC path is used.  Probably not a bug although it's certainly not intuitive.  The result is that a valid UNC path like "file:\\server\folder\" is being read by DocProject as simply, "/folder", which is not a valid absolute URI, hence the exception.  DocProject should be using the LocalPath property, instead of AbsolutePath, if the specified path is UNC.  (DeploymentContext.cs line 128)

Solutions:
Try using the following format, including all doubled slashes and the value 'hack' as the first server name (just to be clear that the URI is a hack :).

file:\\hack\\server\folder\

Alternatively, if all of the website folders are on the same machine then you could map a single drive to the root and use relative paths from there for each DocSite.  For example, map W: to \\server\ and then use:

W:\websites\docsite1\
W:\websites\docsite2\
W:\websites\docsite3\

- Dave
Coordinator
Dec 2, 2008 at 12:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Dec 2, 2008 at 2:02 PM
Great, thanks for the reply Dave.

Your second workaround is what we went with, works well.

P.S. Many thanks for providing this tool, it really is awesome work :)