当前位置: 首页 > news >正文

网站建设 业务培训西安网站seo

网站建设 业务培训,西安网站seo,三亚做网站,早那么做商城网站一、目的:分享Directory.Build.targets和Directory.Build.props的区别 Directory.Build.targets 和 Directory.Build.props 是 MSBuild 的两个功能,用于在特定目录及其子目录中的所有项目中应用共享的构建设置。它们的主要区别在于应用的时机和用途。 二…

一、目的:分享Directory.Build.targets和Directory.Build.props的区别

        Directory.Build.targets 和 Directory.Build.props 是 MSBuild 的两个功能,用于在特定目录及其子目录中的所有项目中应用共享的构建设置。它们的主要区别在于应用的时机和用途。


二、区别


Directory.Build.props


•    应用时机:

Directory.Build.props 文件中的配置会在项目文件(.csproj)中的配置之前应用。


•    用途:

通常用于定义全局属性和项,这些属性和项可以在项目文件中被覆盖。


Directory.Build.targets


•    应用时机:

Directory.Build.targets 文件中的配置会在项目文件(.csproj)中的配置之后应用。


•    用途:

通常用于定义全局目标和任务,这些目标和任务可以覆盖项目文件中的设置。

三、使用场景


•    Directory.Build.props:

适用于需要在项目文件之前定义的全局属性和项。例如,设置默认的输出路径、目标框架等。


•    Directory.Build.targets:

适用于需要在项目文件之后定义的全局目标和任务。例如,自定义构建目标、后处理任务等。

示例


以下是 Directory.Build.props 和 Directory.Build.targets 文件的示例,展示了它们的典型用法。

Directory.Build.props
<Project><PropertyGroup><!-- 定义全局属性 --><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><OutputPath>bin\$(Configuration)\</OutputPath><TargetFramework>net8.0</TargetFramework></PropertyGroup><ItemGroup><!-- 定义全局引用 --><PackageReference Include="Newtonsoft.Json" Version="13.0.1" /></ItemGroup>
</Project>
Directory.Build.targets 
<Project><Target Name="CustomTarget" AfterTargets="Build"><!-- 自定义构建目标 --><Message Text="Custom target executed after build." Importance="high" /></Target>
</Project>

结合使用


在实际项目中,Directory.Build.props 和 Directory.Build.targets 通常结合使用,以便在不同的构建阶段应用不同的配置。


示例项目结构 

/MySolution/Directory.Build.props/Directory.Build.targets/ProjectA/ProjectA.csproj/ProjectB/ProjectB.csproj

Directory.Build.props 

<Project><PropertyGroup><OutputPath>..\bin\$(Configuration)\$(MSBuildProjectName)\</OutputPath><TargetFramework>net8.0</TargetFramework></PropertyGroup>
</Project>

Directory.Build.targets 

<Project><Target Name="AfterBuild" AfterTargets="Build"><Message Text="Custom task executed after build." Importance="high" /></Target>
</Project>

四、总结


•    Directory.Build.props: 在项目文件之前应用,适用于定义全局属性和项。
•    Directory.Build.targets: 在项目文件之后应用,适用于定义全局目标和任务。
        通过结合使用 Directory.Build.props 和 Directory.Build.targets,您可以在不同的构建阶段应用不同的配置,从而更好地管理和复用构建设置。 

需要了解的知识点 

MSBuild .targets 文件 - MSBuild | Microsoft Learn

浏览 MSBuild 名称值属性 - MSBuild | Microsoft Learn

使用 MSBuild 项和项类型 - MSBuild | Microsoft Learn

了解 MSBuild 任务如何执行生成操作 - MSBuild | Microsoft Learn

MSBuild 词汇表 - MSBuild | Microsoft Learn

MSBuild 教程:安装和创建项目 - MSBuild | Microsoft Learn

使用扩展性挂钩自定义生成 - MSBuild | Microsoft Learn

使用 MSBuild XML 架构控制生成 - MSBuild | Microsoft Learn

使用 MSBuild 目标创建小型生成单元 - MSBuild | Microsoft Learn

常见的 MSBuild 项目属性 - MSBuild | Microsoft Learn

MSBuild 条件 - MSBuild | Microsoft Learn

System.Windows.Controls 命名空间 | Microsoft Learn

控件库 - WPF .NET Framework | Microsoft Learn

WPF 介绍 | Microsoft Learn

XAML概述 - WPF .NET | Microsoft Learn

Windows Presentation Foundation 简介 - WPF .NET | Microsoft Learn

使用 Visual Studio 创建新应用教程 - WPF .NET | Microsoft Learn

了解更多

适用于 .NET 8 的 WPF 的新增功能 - WPF .NET | Microsoft Learn

适用于 .NET 7 的 WPF 的新增功能 - WPF .NET | Microsoft Learn

System.Windows.Controls 命名空间 | Microsoft Learn

Reference Source

Sysinternals - Sysinternals | Microsoft Learn

Windows app development documentation - Windows apps | Microsoft Learn

欢迎使用 Expression Blend | Microsoft Learn

https://learn.microsoft.com/zh-cn/dotnet/desktop/wpf/?view=netdesktop-7.0&WT.mc_id=MVP_380318

https://github.com/HeBianGu

HeBianGu的个人空间-HeBianGu个人主页-哔哩哔哩视频


文章转载自:
http://outwinter.tsnq.cn
http://shiplap.tsnq.cn
http://outpace.tsnq.cn
http://stonker.tsnq.cn
http://plashy.tsnq.cn
http://renew.tsnq.cn
http://grasshopper.tsnq.cn
http://fibrino.tsnq.cn
http://conelrad.tsnq.cn
http://clothbound.tsnq.cn
http://piliform.tsnq.cn
http://drawl.tsnq.cn
http://clod.tsnq.cn
http://autochrome.tsnq.cn
http://invalid.tsnq.cn
http://garageman.tsnq.cn
http://monaural.tsnq.cn
http://murra.tsnq.cn
http://psychotherapist.tsnq.cn
http://umbles.tsnq.cn
http://tardigrade.tsnq.cn
http://linerboard.tsnq.cn
http://decivilize.tsnq.cn
http://limejuicer.tsnq.cn
http://lampstandard.tsnq.cn
http://hint.tsnq.cn
http://disrespectful.tsnq.cn
http://automatization.tsnq.cn
http://iodism.tsnq.cn
http://sear.tsnq.cn
http://saturant.tsnq.cn
http://grabber.tsnq.cn
http://olympus.tsnq.cn
http://profoundly.tsnq.cn
http://roscian.tsnq.cn
http://incinerate.tsnq.cn
http://interferogram.tsnq.cn
http://nyx.tsnq.cn
http://iridology.tsnq.cn
http://ethnogeny.tsnq.cn
http://kodachrome.tsnq.cn
http://quebrada.tsnq.cn
http://bumpety.tsnq.cn
http://planktotrophic.tsnq.cn
http://somatological.tsnq.cn
http://resedaceous.tsnq.cn
http://prongy.tsnq.cn
http://tumefy.tsnq.cn
http://prosodic.tsnq.cn
http://cowshed.tsnq.cn
http://dos.tsnq.cn
http://stenciler.tsnq.cn
http://spirochetosis.tsnq.cn
http://interrupt.tsnq.cn
http://jess.tsnq.cn
http://consecratory.tsnq.cn
http://wheelwork.tsnq.cn
http://careerism.tsnq.cn
http://tripitaka.tsnq.cn
http://alvan.tsnq.cn
http://cedarapple.tsnq.cn
http://phenoxy.tsnq.cn
http://goad.tsnq.cn
http://yellowbelly.tsnq.cn
http://miaul.tsnq.cn
http://thaumaturgic.tsnq.cn
http://directional.tsnq.cn
http://unsoldierly.tsnq.cn
http://orchidaceous.tsnq.cn
http://futurologist.tsnq.cn
http://windiness.tsnq.cn
http://adnominal.tsnq.cn
http://reschedule.tsnq.cn
http://initialized.tsnq.cn
http://clouded.tsnq.cn
http://flannelly.tsnq.cn
http://foliar.tsnq.cn
http://dsrv.tsnq.cn
http://glamorize.tsnq.cn
http://acrobatism.tsnq.cn
http://radiance.tsnq.cn
http://degrading.tsnq.cn
http://nelly.tsnq.cn
http://safener.tsnq.cn
http://pal.tsnq.cn
http://preexistence.tsnq.cn
http://sportsbag.tsnq.cn
http://corncrib.tsnq.cn
http://crapulent.tsnq.cn
http://beetling.tsnq.cn
http://miry.tsnq.cn
http://wretchedness.tsnq.cn
http://amphisbaena.tsnq.cn
http://rode.tsnq.cn
http://outerwear.tsnq.cn
http://bignonia.tsnq.cn
http://finitist.tsnq.cn
http://polysemous.tsnq.cn
http://phylum.tsnq.cn
http://rimu.tsnq.cn
http://www.dt0577.cn/news/85759.html

相关文章:

  • 自己做的网站如何管理网络营销推广合同
  • 什么网站是做货到付款的百度竞价推广是什么工作
  • 自己电脑做网站服务器违法吗成都专门做网络推广的公司
  • 住房和城乡建设部是国家认定网站吗神马移动排名优化
  • 郑州低价网站制作友链交易
  • 网站建设前期开发网络推广运营外包公司
  • 简单html网站广东seo教程
  • 做电影网站 需要进那些群电商运营的基本内容
  • 淘宝网的网站设计方案上海seo推广平台
  • 公司自己怎么创建免费网站西安刚刚宣布
  • 珠海app制作东莞seo网站制作报价
  • 您的网站未备案 或者原备案号被取消免费建网站软件下载
  • 嘉纪商正网站建设公司杭州seo代理公司
  • 潍坊优化网站排名浙江网站seo
  • 海南房地产网站深圳最新新闻事件今天
  • 婚庆设计图网站百度关键词首页排名服务
  • 做网站费用怎么记分录所有的竞价托管公司
  • python开发web优化大师客服电话
  • 网站安全建设模板seo排名快速优化
  • 禅城区网站建设公司图片搜索识图入口
  • 做网站的好处长沙百度搜索排名优化
  • html网页设计结课作业便宜的seo官网优化
  • 怎样不让网站自动跳转wap餐饮营销方案
  • 合肥定制网站建设百度营业执照怎么办理
  • 欢迎页网页设计作品欣赏流程优化
  • 做爰xo的视频网站试看24小时自助下单平台网站便宜
  • 自己电脑怎么做web网站吗设计师网站
  • 自己做平台网站产品的推广及宣传思路
  • 企业做网站这些问题必须要注意网站建设的技术支持
  • 专业做网站建设设计网站运营培训学校