在旧版本的 csproj 格式也就是 Franken-proj 格式,可以使用 SolutionDir 拿到当前sln文件所在的文件夹,但是在 SDK Style 格式的项目文件,是拿不到这个属性的,本文告诉大家如何做到兼容之前的逻辑 " AfterTargets="BeforeBuild"> <Warning Text="Solution $(<em>SolutionDir</em>)"/> </Target> 如果我使用 dotnet 命令构建 sln 文件,那么可以输出 sln 所在的文件夹 这就是不同点 但是如果我只是想通过 dotnet 或 msbuild 命令构建 csproj 文件,而不构建 sln 文件,此时还需要使用 SolutionDir 那么请在 sln 文件夹添加一个叫 Directory.Build.props 文件,这个文件可以设置这个文件夹里面的所有项目的构建 而 $(SolutionDir) 属性的含义也就是一个属性,因此只需要返回当前 sln 所在文件夹就可以 <Project> <PropertyGroup> <SolutionDir>$(MSBuildThisFileDirectory)</PackageOutputPath
根据6Plat的使用方法,大概就是分3步, 申请账号 下载软件 连接 申请账号 用你的邮箱,新建邮件: 收件人:6plat@biigroup.cn 主题:6Plat-46个人账号申请 内容:账号 密码 自动回复 下载软件 根据6Plat 46模块的官方帖子,下载对应的软件:Windows端点我下载 解压打开安装下一步下一步就好了。 连接 当你的账号开通之后,打开客户端软件,会提示没有配置文件。 复制以下内容另存为6plat.ovpn,配置内容不知道可以不改。 client dev tun proto tcp remote 46.6plat.org 9185 comp-lzo resolv-retry infinite
我找了很久没有发现 SolutionDir 这个定义,所以只能通过一个不通用的方法找到 在之前的项目可以使用 PreBuildEvent 的方式指定编译之前事件,新的项目格式也可以支持这个方法,只是支持不是很好 我就遇到在 Jenkins 无法编译通过,因为 PreBuildEvent 指定的 $(SolutionDir) 是空 在新的项目格式,找了很久都没有找到 $(SolutionDir) 的定义和找到运行的 README.md | \---src lindexi.csproj 在 Directory.Build.props 添加下面代码 <Project> <PropertyGroup> <SolutionDir >$(MSBuildThisFileDirectory)</SolutionDir> </PropertyGroup> </Project> 因为 $(MSBuildThisFileDirectory
Title Command Arguments Initial directory 在此仓库运行 Git Bash C:\Program Files\Git\git-bash.exe "--cd=$(SolutionDir "$(SolutionDir)/.." 在资源管理器中打开仓库 C:\Windows\explorer.exe /select,"$(SolutionDir)\." "$(SolutionDir)\."
前言 最近客户反馈,为啥不用xcopy命令代替我自己写的命令来完成插件编译复制: 我的: <PostBuildEvent>call "$(SolutionDir)tools\tools\Magicodes.CmdTools.exe " copy -s "$(SolutionDir)plus\Jxy.WeChat\Jxy.WeChat.Core\bin\Debug\net461\Jxy.WeChat.Core.dll" -t "$( SolutionDir)src\Magicodes.Admin.Web.Mvc\wwwroot\PlugIns"</PostBuildEvent> <RunPostBuildEvent>OnBuildSuccess </RunPostBuildEvent> 推荐的: call xcopy /s /y "$(TargetPath)" "$(SolutionDir)src\ Magicodes.Admin.Web.Mvc <PropertyGroup> <PostBuildEvent> echo 准备复制"$(TargetPath)" call xcopy /s /y "$(TargetPath)" "$(SolutionDir
以便快速输入 git 命令 [Title] 打开 Git Bash [Command] C:\Program Files\Git\git-bash.exe [Arguments] --cd="$(SolutionDir [InitialDirectory] "$(SolutionDir)" 用于快速打开解决方案所在的文件夹(通常这也是 git 仓库的根目录) [Title] 在资源管理器中查看此解决方案 [Command ] C:\Windows\explorer.exe [Arguments] /select,"$(SolutionDir)$(SolutionFileName)" [InitialDirectory] "$(SolutionDir)" 用于快速打开当前正在编辑的文件所在的文件夹 [Title] 在资源管理器中查看此文件 [Command] C:\Windows\explorer.exe [Arguments )" [InitialDirectory] "$(SolutionDir)" 使用 TortoiseGit 来 Blame 此文件(而且还会自动定位到当前行) [Title] 追溯此文件 [Command
)dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -o $(SolutionDir)Buildvm/buildvm_arch.h archdasc/vm_x86.dasc 在工程设置中设置C\C++->General->Additional Include Directories为"$(SolutionDir)Lj";"$(SolutionDir)Header"。 -o $(SolutionDir)Builvmheader\lj_libdef.h %ALL_LIB% $(OutDir)\buildvm.exe -m recdef -o $(SolutionDir 在C\C++->General->Additional Include Directories设置"$(SolutionDir)Header";"$(SolutionDir)OtherHeader";" $(SolutionDir)Lj";"$(SolutionDir)Builvmheader";"$(SolutionDir)OtherLualib";"$(SolutionDir)Lualib"。
如果你看过我上一篇文章,你应该知道我们至少具有解决T4模板的程序集引用的五种方案,在这里我们采用的是VS宏的解决方案,即将引用程序集文件的路径设置成通过$(SolutionDir)表示的解决方案目录的相对路径 HelloWorld.tt定义如下,引用的程序集路径为Lib项目在Debug模式下编译生成的目录($(SolutionDir)Lib\Bin\Debug\)。 <#@ template debug="true" hostSpecific="true" #> <#@ output extension=".cs" #> <#@ Assembly name="$(<em>SolutionDir</em> @ VolatileAssembly…#>(<#@ VolatileAssembly processor="T4Toolbox.VolatileAssemblyProcessor" name="$(<em>SolutionDir</em> output extension=".cs" #> <#@ VolatileAssembly processor="T4Toolbox.VolatileAssemblyProcessor" name="$(<em>SolutionDir</em>
开关 略(见原文) 示例 MSBuild.exe MyProject.proj -t:rebuild 问题 1、VS 中的生成前事件中参数未被识别的问题 项目中有如下生成事件,其中使用了 $(SolutionDir ) 参数: 在使用 Jenkins 的 MSBuild 插件进行编译项目时发现该命令不能被识别: 参考《[使用 MSBuild Tools 调用 csproj 项目文件发布网站时 $(SolutionDir ) 宏参数值丢失为空的解决方案](https://www.cnblogs.com/VAllen/p/how-to-get-rid-of-solutiondir-when-building-vs-project-from-outside-visual.html )》可知,可以使用 -p 开关来指定参数的值,如下: MSBuild D:JenkinsDataworkspaceSrcdesktop.sln -p:SolutionDir=D:JenkinsDataworkspaceSrc DEBUG /project %desktop_dir%UIMain.Gui.csproj MSBuild %desktop_dir%UIMain.Gui.csproj -p:WarningLevel=0;SolutionDir
生成目录:$(SolutionDir)bin$(Platform)$(Configuration) 缓存目录:$(SolutionDir)tmp$(Platform)$(Configuration)$(
如: Terminal window xcopy /E /Y $(SolutionDir)_Externals\Refs\LiteDB.2.0.2.0\*.dll $(OutDir)LiteDB.2.0.2.0 \xcopy /E /Y $(SolutionDir)_Externals\Refs\LiteDB.4.0.0.0\*.dll $(OutDir)LiteDB.4.0.0.0\ 这样,不仅可以将 dll
Debug下的mysqlpp_d.lib mysqlpp_d.dll拷贝到上述lib文件夹中 g、通过和3步骤一样的方法将工程下的include、lib这两个路径添加到工程属性中(可以使用(SolutionDir )\include、(SolutionDir)\lib) h、将libmysql.lib mysqlpp_d.lib 添加到引用库 i、编译运行,报错没有libmysql.dll、 mysqlpp_d.dll这两个库,将$(SolutionDir)\lib中的这两个库拷贝到Debug目录下就行了。
Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir
本文告诉大家如何使用 WriteLinesToFile 先把参数写入文件,通过文件的方式传输参数 Roslyn 获得 sln 文件所在的文件夹 我找了很久没有发现 SolutionDir 这个定义,所以只能通过一个不通用的方法找到 在之前的项目可以使用 PreBuildEvent 的方式指定编译之前事件,新的项目格式也可以支持这个方法,只是支持不是很好 我就遇到在 Jenkins 无法编译通过,因为 PreBuildEvent 指定的 $(SolutionDir ) 是空 在新的项目格式,找了很久都没有找到 $(SolutionDir) 的定义和找到运行的 sln 文件的定义的方法 于是通过 Directory.Build.props 的方法找到 sln 文件 README.md | \---src lindexi.csproj 在 Directory.Build.props 添加下面代码 <Project> <PropertyGroup> <SolutionDir >$(MSBuildThisFileDirectory)</SolutionDir> </PropertyGroup> </Project> 因为 $(MSBuildThisFileDirectory
设置项目主程序生成后事件 参考命令: IF "$(ConfigurationName)" == "Release" ( "$(SolutionDir)DevOps\InnoSetup\ISCC.exe " "$(SolutionDir)DevOps\InnoSetup\KJTStep.iss" start explorer /select,"$(SolutionDir)DevOps\Publish
优化后的sql如下: select winEnd,split_index(plat1,'_',0) as plat2,sum(pv) from ( select TUMBLE_END(proc_time , INTERVAL '1' MINUTE) as winEnd,plat1,count(*) as pv from ( -- 最内层,将分组的key,也就是plat加上一个随机数打散 select plat || '_' || cast(cast(RAND()*100 as int) as string) as plat1 ,proc_time from source_kafka_table ) group by TUMBLE(proc_time, INTERVAL '1' MINUTE), plat1 ) group by winEnd,split_index(plat1,'_', 0) 在这个sql的最内层,将分组的key,也就是plat加上一个随机数打散,然后求打散后的各个分组(也就是sql中的plat1)的pv值,然后最外层,将各个打散的pv求和。
*/ if (plat_dev.major){ plat_dev.devid = MKDEV(plat_dev.major, 0); register_chrdev_region (plat_dev.devid, PLATDRV_NUM, PLATDRV_NAME); } else { alloc_chrdev_region(&plat_dev.devid , 0, PLATDRV_NUM, PLATDRV_NAME); plat_dev.major = MAJOR(plat_dev.devid); } /* 2. (&plat_dev.cdev, plat_dev.devid, PLATDRV_NUM); /* 3. unregister_chrdev_region(plat_dev.devid, PLATDRV_NUM); device_destroy(plat_dev.class, plat_dev.devid
版本为vs2023.输出目录:如果我们建立一个默认的vc项目Test1,他的默认“常规“栏目中,“输出目录”为$(SolutionDir)$(ConfigurationName),所以调试时会在解决方案文件夹下建立一个 $(SolutionDir):解决方案名,即.sln所在路径$(Platform):解决方案平台名称,如x86、x64$(Configuration):当前的编译配置名称,如Release、Debug$
=hx_plat_new_dump DUMPFILE=hx_plat_new.dmp 这里大概就是使用sys这个用户(密码:1234)作为sysdba身份登录,要导出的schema是hx_plat_new impdp \'sys/oracle as sysdba\' remap_schema=HX_PLAT_NEW:HX_PLAT_SPLIT_TEST remap_tablespace=HX_PLAT_NEW :HX_PLAT_SPLIT_TEST DIRECTORY=DATA_PUMP_DIR DUMPFILE=hx_plat_new.dmp schemas=HX_PLAT_SPLIT_TEST 发现还是报错 ,后面去掉了最后的schemas=HX_PLAT_SPLIT_TEST: impdp \'sys/oracle as sysdba\' remap_schema=HX_PLAT_NEW:HX_PLAT_SPLIT_TEST remap_tablespace=HX_PLAT_NEW:HX_PLAT_SPLIT_TEST DIRECTORY=DATA_PUMP_DIR DUMPFILE=hx_plat_new.dmp 嗯,
场景描述 有张工单版本对应表bus_mark_plat_ver,表结构如下: 字段 类型 注释 id int(10) sys_code varchar(20) 系统类型 version_code varchar CREATE TABLE bus_mark_plat_ver_tmp LIKE bus_mark_plat_ver; 将要保留的数据存储到临时表中 INSERT INTO bus_mark_plat_ver_tmp , version_code, mark_id; 删除原表中的数据 delete from bus_mark_plat_ver 将临时表中的数据加入到原表中 INSERT INTO bus_mark_plat_ver SELECT id,sys_code,version_code,mark_id FROM mng_navigation_banner_plat_ver_tmp; 删除临时表 DROP TABLE bus_mark_plat_ver_tmp; 创建临时表的优点: 简单直观:通过创建临时表,您可以明确地将要删除的数据和要保留的数据分开存储,易于理解和管理。