MSBuild OutputPath property and absolute paths

后端 未结 4 1106
囚心锁ツ
囚心锁ツ 2021-01-12 06:59

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

c:\\Projects\\xxx\\Deployment

But I get t

相关标签:
4条回答
  • 2021-01-12 07:06
    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>
    0 讨论(0)
  • 2021-01-12 07:12

    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>
    
    0 讨论(0)
  • 2021-01-12 07:14

    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 &quot;$(TargetPath)&quot; &quot;$(CentralisedBinariesFolderLocation)&quot;" />
    </Target>
    

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

    0 讨论(0)
  • 2021-01-12 07:21

    Instead of all the steps in the October answer, is it not possible just to define WebPublishPipelineProjectDirectory with the same path as OutputPath?

    I tried it in my CI solution (using CruiseControl) and it seemed to work.

    Does anyone know of any side effects that are not apparent to me from doing this?

    0 讨论(0)
提交回复
热议问题