【问题标题】:C# project additional output pathC#项目附加输出路径
【发布时间】:2011-08-02 01:10:29
【问题描述】:

在工程文件中,通常我们可以看到如下设置工程输出路径。现在我想知道是否有办法设置额外的输出路径。即,构建的二进制文件也将被复制到其他路径。

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  <DebugSymbols>true</DebugSymbols>
  <DebugType>full</DebugType>
  <Optimize>false</Optimize>
  <OutputPath>bin\Debug\</OutputPath>
  <DefineConstants>DEBUG;TRACE</DefineConstants>
  <ErrorReport>prompt</ErrorReport>
  <WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  <DebugType>pdbonly</DebugType>
  <Optimize>true</Optimize>
  <OutputPath>bin\Release\</OutputPath>
  <DefineConstants>TRACE</DefineConstants>
  <ErrorReport>prompt</ErrorReport>
  <WarningLevel>4</WarningLevel>
</PropertyGroup>

【问题讨论】:

    标签: c# msbuild build project-management


    【解决方案1】:

    将构建后事件添加到您的项目/解决方案配置中将是微不足道的,它将文件从原始构建位置复制到您指定的新位置。转到您的项目属性,然后在“构建事件”下将以下内容添加到您的构建后事件命令行:

    xcopy /E $(ProjectDir)bin\Release\ [pathToMyDestination]
    

    顺便说一句,我猜您想将发布版本发布到主机。在这种情况下,值得研究持续集成软件,它可以为您提供强大的功能。我们已经使用了几个,目前正在使用 Team City(免费)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-02
      • 1970-01-01
      • 2016-06-27
      • 2016-10-05
      • 2021-12-30
      • 2018-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多