当前位置:网站首页>Roslyn 在 msbuild 的 target 判断文件存在
Roslyn 在 msbuild 的 target 判断文件存在
2022-08-04 15:38:00 【林德熙】
在使用 msbuild 定义编译时运行的逻辑,可以使用 Exists 判断文件是否存在
假设需要判断某个文件是否存在,如果存在则执行逻辑,如删除这个文件,可以使用下面代码
<PropertyGroup>
<SourceProjectPackageFile>SourceProjectPackageFile.txt</SourceProjectPackageFile>
</PropertyGroup>
<Delete Files="$(SourceProjectPackageFile)" Condition="Exists($(SourceProjectPackageFile))"></Delete>
上面代码就可以用来删除定义的 SourceProjectPackageFile.txt 文件
边栏推荐
猜你喜欢
项目里的各种配置,你都了解吗?
Xi'an Zongheng Information × JNPF: Adapt to the characteristics of Chinese enterprises, fully integrate the cost management and control system
Redis持久化操作
RSA306B,500,600系列API接口代码
"Research Report on the Development of Global Unicorn Enterprises in the First Half of 2022" released - DEMO WORLD World Innovation Summit ended successfully
Online Excel based on Next.js
GPS卫星同步时钟,NTP网络同步时钟,北斗时钟服务器(京准)
什么是 DevOps?看这一篇就够了!
What is the difference between ITSM software and a work order system?
从-99打造Sentinel高可用集群限流中间件
随机推荐
弄懂#if #ifdef #if defined
JVM调优-GC基本原理和调优关键分析
字节API鉴权方法
【Go事】一眼看穿 Go 的集合和切片
实战:10 种实现延迟任务的方法,附代码!
现代 ABAP 编程语言中的正则表达式
一文详解什么是软件部署
inter-process communication
成员变量与局部变量的区别有哪些
H5 开发内嵌页面跨域问题
remote: Check Access Error, please check your access right or username and password!fatal: Authenti
2022杭电多校3
多商户商城系统功能拆解24讲-平台端分销会员
性能提升400倍丨外汇掉期估值计算优化案例
农产品期货开户哪家好??
PHP 图片转PDF
#夏日挑战赛# HarmonyOS 实现一个滑块验证
分支控制if-else
What is the difference between ITSM software and a work order system?
Next -18- 添加代码复制按钮