tags:

views:

176

answers:

3

I'm trying to set the OutputPath value to an absolute path:

<OutputPath>c:\Projects\xxx\Deployment</OutputPath>

But I get this error:

Error   17  The expression "[System.IO.Path]::GetFullPath(D:\Projects\xxx\trunk\xxx.Web.Deployment\c:\Projects\xxx\Deployment\)" cannot be evaluated. The given path's format is not supported.     1   1   xxx.Web.Deployment

Is there a way to use an absolute path with the OutputPath property? I've tried experimenting with the BaseOutputPath property:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'">
  <BaseOutputPath>C:\Projects\xxx\</BaseOutputPath>
  <OutputPath>.\Deployment</OutputPath>
  <EnableUpdateable>true</EnableUpdateable>
  <UseMerge>true</UseMerge>
  <SingleAssemblyName>xxx.Web.Deployment</SingleAssemblyName>

But it seems to get ignored. What are BaseOutputPath and BaseIntermediateOutputPath used for?

+1  A: 

I'm not sure whether you can do what you're talking about, but you can add something similar to the following:

<PropertyGroup>  
    <CentralisedBinariesFolderLocation>c:\wherever</CentralisedBinariesFolderLocation>
</PropertyGroup>  

<Target Name="AfterBuild">
    <Exec Command="xcopy /Y /S /F /R $(TargetPath) $(CentralisedBinariesFolderLocation)" />
</Target>

Which will copy it to the relevant location after the build.

pm_2
Think this is the way to go as well. I have one small problem though, $(TargetPath) returns nothing. Is there another variable I can use to get the deployment path?
Frederik Vig
Got it working with: <Exec Command="xcopy /Y /S /F /R $(MSBuildProjectDirectory)\Deployment $(CentralisedBinariesFolderLocation)" />. Not very elegant, but worked in my case. Please let me know if there is a better way! :)
Frederik Vig
A: 

Try using OutDir instead of OutputPath :

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'">
  <OutDir>C:\Projects\xxx\$(Configuration)</OutDir>
  <EnableUpdateable>true</EnableUpdateable>
  <UseMerge>true</UseMerge>
  <SingleAssemblyName>xxx.Web.Deployment</SingleAssemblyName>
</PropertyGroup>
madgnome
A: 
  1. Copy the .target and .dll files from the installer directory
  2. Modify the lines at the top that look like <UsingTask TaskName="GetProjectProperties" AssemblyFile="../../ ..lallal/VisualStudio/v10.0/Microsoft.Web.Publishing.Tasks.dll"/> and c*opy those .target and .dll files to your vendors folder next to the copied Microsoft.WebDeployment.targets-file your are editing*. Set the attr, AssemblyFile="Microsoft.Web.Publishing.Tasks.dll"
  3. Add the line <EnablePackageProcessLoggingAndAssert Condition="'$(EnablePackageProcessLoggingAndAssert)' == ''">True</EnablePackageProcessLoggingAndAssert> to the initial PropertyGroup.
  4. Set the OutputPath as you wish in the actual file/other tagets/other build-proj file.
  5. Edit line ~290 to <WebPublishPipelineProjectDirectory Condition="'$(WebPublishPipelineProjectDirectory)'==''">$(OutputPath)</WebPublishPipelineProjectDirectory>
Henrik