C# .csproj Baseoutputpath/Outputpath、AppendTargetFrameworkToOutputPath

参考:

Common MSBuild Project Properties - MSBuild | Microsoft Learn

目前看来,二者都指定输出地址。

前者会添加当前项目的配置属性:

后者:

  • 直接使用指定的路径作为输出目录

  • 不会添加额外的配置(Debug/Release)和框架(net461\.Net 2...)子目录

远程调试时想把exe直接输出到远程计算机上,可以这样设置:

XML 复制代码
<PropertyGroup>
  <OutputType>WinExe</OutputType>
  <TargetFramework>net461</TargetFramework>
  <UseWPF>true</UseWPF>
 <LangVersion>11.0</LangVersion>
  <SignAssembly>false</SignAssembly>
  <ApplicationManifest>app.manifest</ApplicationManifest>
  <Version>1.4.0</Version>
  <ApplicationIcon>Resource\Image\burger.ico</ApplicationIcon>
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
  <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 <!--<OutputPath Condition="'$(Configuration)'=='Debug'">\bin\Output\</OutputPath>
 <OutputPath Condition="'$(Configuration)'=='远程'">\\DESKTOP-V21FG2T\Share\FluentVision\bin\Output\远程\</OutputPath>-->
  <!--<OutputPath>bin\Output\</OutputPath>-->
  <OutputPath>\\DESKTOP-V21FG2T\Share\FluentVision\bin\Output\远程\net461</OutputPath>
  <!--<BaseOutputPath>\\DESKTOP-V21FG2T\Share\FluentVision\bin\Output</BaseOutputPath>-->
  <PackAsTool>False</PackAsTool>
  <PackageOutputPath>\\DESKTOP-V21FG2T\Share\FluentVision\bin\Output</PackageOutputPath>
  <PlatformTarget>x64</PlatformTarget>
  <Configurations>Debug;Release;远程</Configurations>
</PropertyGroup>

还没研究明白区别到底在哪里,可以多试试,Baseoutputpath/Outputpath都尝试设置一遍然后查看输出是否成功;

AppendTargetFrameworkToOutputPath:

为false时:

为true时:

多了一层框架名称文件夹。

未完

相关推荐
DevOpenClub4 小时前
Markdown、HTML 和 PPT 如何稳定交付:文档转换任务的幂等发布流程
开发语言·前端·c#·html·powerpoint
软件黑马王子5 小时前
3.单例模式问题1:构造函数
开发语言·单例模式·c#
软件黑马王子5 小时前
4.单例模式问题2:重复挂载
开发语言·单例模式·c#
夏霞7 小时前
c# 不支持的目标框架 解决方案
开发语言·c#
软件黑马王子7 小时前
5.单例模式问题3:多线程问题
单例模式·前端框架·c#
geovindu7 小时前
CSharp: Template Method Pattern
开发语言·后端·c#·.net·模板方法模式·行为模式
CSDN_RTKLIB7 小时前
SetImpliedSelection
c#
软件黑马王子7 小时前
1.non-MonoBehaviour 单例模式泛型基类
unity·前端框架·c#
高彬8 小时前
SAP ECC6.0 对接 C# web Services服务
开发语言·前端·c#·sap
半亩码田8 小时前
C#转Python第4.4篇:JSON 处理:json 模块 vs System.Text.Json
python·c#·json