【问题标题】:How to get the build output in a specific target directory using Visual Studio (maybe MsBuild)如何使用 Visual Studio(可能是 MsBuild)在特定目标目录中获取构建输出
【发布时间】:2021-01-19 09:36:49
【问题描述】:

使用 .NET 项目编译类库,并保存项目文件

  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
      <OutputPath>C:\aaa</OutputPath>
  </PropertyGroup>

在程序集中的结果

   c:\aaa\net48

我需要他们直接

   c:\aaa

实现这一目标最务实的方法是什么?

我尝试将配置设置为空值

<Configuration></Configuration>

但这没有任何效果。

【问题讨论】:

    标签: .net visual-studio build msbuild


    【解决方案1】:

    尝试使用OutDir属性覆盖路径。

    使用这个:

     <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> 
        <OutDir>C:\aaa\</OutDir>
    </PropertyGroup>
    

    【讨论】:

      猜你喜欢
      • 2017-12-05
      • 2013-09-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      • 2018-03-03
      • 2014-01-27
      • 1970-01-01
      • 2017-05-01
      相关资源
      最近更新 更多