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时:

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

未完

相关推荐
初九之潜龙勿用1 小时前
C#实现导出Word图表通用方法之散点图
开发语言·c#·word·.net·office·图表
曹牧2 小时前
C#:WebReference
开发语言·c#
C#程序员一枚2 小时前
C#AsNoTracking()详解
开发语言·c#
明月看潮生2 小时前
编程与数学 03-008 《看潮企业管理软件》项目开发 01 需求分析 3-1
c#·.net·需求分析·erp·企业开发·项目实践·编程与数学
人工智能AI技术3 小时前
【C#程序员入门AI】环境一键搭建:.NET 8+AI开发环境(Semantic Kernel/ML.NET/ONNX Runtime)配置
人工智能·c#
CreasyChan3 小时前
unity 对象池实测可用
unity·c#
一个帅气昵称啊3 小时前
AI搜索增强C#实现多平台联网搜索并且将HTML内容转换为结构化的Markdown格式并整合内容输出结果
人工智能·c#·html
云草桑4 小时前
在C# .net中RabbitMQ的核心类型和属性,除了交换机,队列关键的类型 / 属性,影响其行为
c#·rabbitmq·.net·队列
guygg884 小时前
C#实现的TCP/UDP网络调试助手
网络·tcp/ip·c#