Deployment URI Format

Topics: DocSites, General Questions
Dec 2, 2008 at 10: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?
Dec 2, 2008 at 12:55 PM

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

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)

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 :).


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:


- Dave
Dec 2, 2008 at 1: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 3: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 :)