Spaces in path property substitutions problematic

Topics: User Forum
Apr 2, 2009 at 2:22 PM
I was pleased to see that SHFB was adopting the msbuild project format.  I installed the updates (latest Beta) and updated my 1.6/1.7 .shfb project file to 1.8.
I opened the project mydoc.shfbproj and changed

<

DocumentationSources>
    <
DocumentationSource sourceFile="x\some\long\absolute\path\with a space\myassembly.exe" />
...
</DocumentationSources>

To
<DocumentationSources>
    <
DocumentationSource sourceFile="$(sourceFilePath)myassembly.exe" />
...
<DocumentationSources>

I then ran msbuild mydoc.shfbproj /p:sourceFilePath="x\some\long\absolute\path\with a space\"

The result was an error:
"C:\Projects\TFS\Path\To\mydoc.shfbproj" (default target) (1) ->(CoreBuildHelp target) ->
  C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets(23,5): error MSB4018: The "BuildHelp" task failed unexpectedly.\r
C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets(23,5): error MSB4018: SandcastleBuilder.Utils.BuilderException: Error reading project from 'C:\Projects\TFS\Path\To\mydoc.shfbproj':\r
C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets(23,5): error MSB4018: 'myassembly.exe' is an unexpected token. Expecting white space. Line 1, position 300. ---> System.Xml.XmlException: 'CorvusEncoder.XML' is an unexpected token. Expecting white space. Line 1, position 300.\r
C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets(23,5): error MSB4018:    at System.Xml.XmlTextReaderImpl.Throw(Exception
 e)\r
...
If I set an environment variable sourceFilePath=x\some\long\absolute\path\with a space\ (no quotes) and then ran msbuild mydoc.shfbproj it proceeded successfully.
If I changed the value of the property passed on the command line to use the short (8.3) name format, running
msbuild mydoc.shfbproj /p:sourceFilePath=x\some\long\absolute\path\withas~1\ it ran correctly.

I tried using msbuild mydoc.shfbproj /p:sourceFilePath="&quot;x\some\long\absolute\path\with a space\&quot;" but that failed.

Is there a way to pass a path property containing spaces?  Unfortunately I have little control over path naming.

Using property values in paths make it that much easier to use with Team Build (VSTS 2008).

I have installed SHFB 1.8.0.0 and Sandcastle version 2.4(.10520.1).
Dick

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coordinator
Apr 2, 2009 at 4:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Apr 2, 2009 at 4:43 PM
I've created a work item and will look into it as spaces in the path shouldn't be an issue.  By the way, the variables are supported within the GUI.  You can enter "$(SourceFilePath)SomeAssembly" in the documentation source's SourceFile property.  The project's UserDefinedProperties property can be used to add custom MSBuild project properties like SourceFilePath so that you can supply a default value and build from within the GUI.

Eric
Apr 2, 2009 at 4:56 PM
I notice in my example that my error message edit left the file name CorvusEncoder.XML. This could be confusing. The file name should have been myassembly.exe for this example.