Share via


How to: Find Paths to Deployment Output Files in Deployment Reports

In the XML deployment report, you can view information about the directory structure created at the deployment output location. This structure is created so that the application files needed for deployment can be copied to that location when the deployment report is generated. You can then use this information to retrieve the path to each application file. For more information, see Application Information in Deployment Reports and Location and Directory Structure of Deployment Output Files.

To retrieve the full path to an application directory or file

  1. Open the XML version of the deployment report.

  2. Locate the <Applications> element, then the <Application> element for the application, then the "Directory" <Resource> element.

  3. Within the "Directory" element, find the "Path" <Setting> element, and then the "Assigned" <Facet> element.

    Under the "Directory" element, a group of <Resource> elements describe directories created on disk and the files copied to those directories for the application.

  4. To obtain the path up to the application directory, retrieve the value from the "Assigned" element.

    Tip

    The value of the "Assigned" element is specified by the Destination Path property of the deployment report. To view this property, right-click the deployment diagram surface and choose Properties. You can also click the deployment diagram surface and press F4.

  5. Within the "Directory" element, locate the <Resource> element for each subdirectory or file, and then the "Current" <Facet> element.

    Tip

    Each <Resource> element has an "Extends" attribute that identifies the element as "Microsoft_FileSystem:Directory" for a directory or "Microsoft_FileSystem:File" for a file. The <Resource> element for a file also omits any white space or periods in file names.

  6. To obtain the path from the application directory to the subdirectory or file, retrieve the value from the "Current" element.

Combining the path from the "Directory" element with path from subdirectory or file <Resource> element produces the full path to that subdirectory or file.

Note

You might need to add backward slash marks (\) where appropriate to produce a valid path.

Example

The following example contains a "Directory" element for a Windows application. This element contains <Resource> elements that describe the directories created at the output location and the files copied to that location.

<Resource Name="Directory" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory" Extends="Microsoft_FileSystem:Directory" InstanceId="5badb907-1e78-4da7-8da1-2857288489e0">
   ...
   <Resource Name="MyProject" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.DirectoryResource" Extends="Microsoft_FileSystem:Directory" InstanceId="a7e6a8d8-a961-4cb3-8ed2-31ac0824581a">
   <Resource Name="WebReferences" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.DirectoryResource1" Extends="Microsoft_FileSystem:Directory" InstanceId="52204baa-4dd7-4084-8ba7-e4fb6f13694d">
   <Resource Name="MyWinAppDefinitionvbproj" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource4" Extends="Microsoft_FileSystem:File" InstanceId="d0816ea3-d101-4010-9845-203d97af1d38">
   ...
   <Resource Name="Form1Designervb" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource3" Extends="Microsoft_FileSystem:File" InstanceId="b0d70dc9-4959-424e-b133-601c00a8451c">
   ...
   <Resource Name="appconfig" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource" Extends="Microsoft_FileSystem:File" InstanceId="0c34fdf7-84e0-42a6-baf3-d726d3fd5660">
   ...
   <Resource Name="Form1vb" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource2" Extends="Microsoft_FileSystem:File" InstanceId="75133b44-295c-40f6-8033-20817d8c8b30">
   ...
   <Resource Name="MyWinAppDefinitionsdm" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource1" Extends="Microsoft_FileSystem:File" InstanceId="aca72d6e-6f4b-47f9-b760-73de03bee50c">
   ...
</Resource>

The following example contains a Windows application's "Directory" element. This element describes the project directory at the specified output location. The example also contains a "Path" <Setting> element. This element contains <Facet> elements describing the path information for that project directory. The example also contains a <Resource> element for the App.config file, the "Path" <Setting> element for that file, and <Facet> elements describing the path information for that file.

In this example, the full path to the App.config file of this Windows project is obtained from two locations:

  • The value of the "Assigned" <Facet> element under the "Directory" element: "C:\My Documents\My Distributed System\Deployment".

  • The "Current" <Facet> element of the App.config file <Resource> element: "MyWinAppDefinition\app.config".

Therefore, combining these two paths with a backward slash mark (\) produces the full path to the App.config file: "C:\My Documents\My Distributed System\Deployment\MyWinAppDefinition\app.config".

Note

The App.config file should be renamed as MyApplicationName.exe.config at deployment. For more information, see Location and Directory Structure of Deployment Output Files.

<Resource Name="Directory" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory" Extends="Microsoft_FileSystem:Directory" InstanceId="5badb907-1e78-4da7-8da1-2857288489e0">
   <Setting Name="Path" Definition="Microsoft_FileSystem:Path">
      <Facet Name="Assigned" Definition="Microsoft_FileSystem:Path" State="Set"> 
         <Value>C:\My Documents\My Distributed System\Deployment</Value> 
      </Facet>
      <Facet Name="Parent" Definition="Microsoft_FileSystem:Path" State="Set" Null="true" />
      <Facet Name="Current" Definition="Microsoft_FileSystem:Path" State="Set">
         <Value>MyWinAppDefinition</Value>
      </Facet>
   </Setting>
   ...
   <Resource Name="appconfig" Definition="MyWinAppDefinition:MyWinAppDefinition.Directory.FileResource" Extends="Microsoft_FileSystem:File" InstanceId="ad03d65a-9075-4822-b3f9-2fad1fba0a4f">
   ...
      <Setting Name="Path" Definition="Microsoft_FileSystem:Path">
         <Facet Name="Assigned" Definition="Microsoft_FileSystem:Path" State="Set" Null="true" /> 
         <Facet Name="Parent" Definition="Microsoft_FileSystem:Path" State="Set">
            <Value>MyWinAppDefinition</Value> 
         </Facet>
         <Facet Name="Current" Definition="Microsoft_FileSystem:Path" State="Set"> 
            <Value>MyWinAppDefinition\app.config</Value> 
         </Facet>
      </Setting>
   </Resource>
   ...
</Resource>

See Also

Concepts

Overview of Deployment Using Deployment Reports

Reference

Overview of Key Sections in Deployment Reports