【问题标题】:Visual studio custom build configuration working mechanism behavior Debug/Release or something else?Visual Studio 自定义构建配置工作机制行为 Debug/Release 还是别的什么?
【发布时间】:2019-11-27 10:15:12
【问题描述】:

我有一个查询,比如当我们在 Visual Studio 中构建项目时,我们得到了默认的两个配置调试和发布......并且两者都有不同的行为,比如说发布比调试更优化。

但是,当我们进行自定义配置并且不从调试和发布中选择复制设置并留空时,如果我们构建解决方案,编译器将如何在此处执行操作....例如调试/发布或其他内容....什么构建后会得到什么样的二进制文件?

请帮忙...

【问题讨论】:

  • PlatformTargetAssemblyName 在您的 csproj 文件中定义。如果您还没有更新它,默认值将用于自定义构建配置
  • 你也可以看看这个thread

标签: .net visual-studio msbuild


【解决方案1】:

如果您将所有内容留空,则将使用默认的 ConfigurationPlatform。您可以通过检查您的 csproj 文件找到它

  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
  ...
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>

您需要为您的自定义构建配置指定相同的内容

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-19
    • 2017-05-10
    • 2011-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-11
    • 2015-06-25
    相关资源
    最近更新 更多