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

免费企业营销网站制作百度搜索引擎营销

免费企业营销网站制作,百度搜索引擎营销,网站用户引导,注册公司网页使用Visual Studio打开解决方案&#xff0c;对<网站项目>右键点击<发布>&#xff0c;一切都是正常的&#xff0c;所有宏都可用&#xff0c;宏参数值也是正确的。 而通过批处理脚本命令调用MSBuild.exe对解决方案编译&#xff0c;一切也都是正常的&#xff0c;所有宏…

使用Visual Studio打开解决方案,对<网站项目>右键点击<发布>,一切都是正常的,所有宏都可用,宏参数值也是正确的。

而通过批处理脚本命令调用MSBuild.exe对解决方案编译,一切也都是正常的,所有宏都可用,宏参数值也是正确的。

但如果你通过批处理脚本命令调用MSBuild.exe对解决方案下某个Web项目进行发布操作时,你会发现,某些针对解决方案可用的宏变得不正常,不可用,宏参数值都是错误的。

例如$(SolutionDir)在某些版本的MSBuild下它的值是"",某些版本的MSBuild下它的值是"..\"。

 

那么,这个有解决方法吗?答案是有的。

MSBuild有个/p命令选项,支持外部传值重置宏参数值。

在批处理命令里添加“/p:SolutionDir=path”选项,即可让$(SolutionDir)重新变为正常可用。

下面是我某个项目中提供给CI调用的发布/部署脚本文件代码:

echo Publish parameters initializing...::These parameters are not used for the time being
::set DotNetFrameworkPath=%windir%\Microsoft.NET\Framework
::if exist %windir%\SysWOW64 set DotNetFrameworkPath=%windir%\Microsoft.NET\Framework64:Set user level's parameters
set SolutionPath=%~dp0..\src\
set SolutionName=Demo
set SolutionFile=%SolutionPath%%SolutionName%.sln
set ProjectName=WebTestset ProjectFile=%SolutionPath%%ProjectName%\1621.%ProjectName%.csproj
set PublishProfile=WebTestDeployToRelease
set IfUseNuGetReStore=Y % value is Y or N %
set IfUpdateNuGetTool=Y % value is Y or N %:Set system level's parameters
set Configuration=Release
set LogLevel=normal
:: Note: That the MSBuild tool version and VisualStudio version and the TargetFramework version have dependencies
set VisualStudioVersion=14.0
set TargetFrameworkVersion=4.6.1
set MicrosoftSdkVersion=v10.0Aset NuGetPath=%SolutionPath%.nuget\
set NuGetExe=%NuGetPath%NuGet.exe
set NuGetArgs=restore "%SolutionFile%"set AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\%MicrosoftSdkVersion%\bin\NETFX %TargetFrameworkVersion% Tools"
set MSBuildPath=C:\Program Files (x86)\MSBuild\%VisualStudioVersion%\Bin
set MSBuildExe=%MSBuildPath%\MSBuild.exe
set MSBuildArgs=/p:Configuration=%Configuration%;VisualStudioVersion=%VisualStudioVersion%;TargetFrameworkVersion=%TargetFrameworkVersion%;SolutionDir=%SolutionPath% /p:DeployOnBuild=true;PublishProfile=%PublishProfile% /p:AspnetMergePath=%AspnetMergePath% /verbosity:%LogLevel% /l:FileLogger,Microsoft.Build.Engine;encoding=utf-8;append=true;logfile=build\%ProjectName%_%Configuration%_Publish.logecho Publish parameters initialize completed.if %IfUseNuGetReStore% == Y (
if %IfUpdateNuGetTool% == Y (
echo NuGet tools Start updating...
"%NuGetExe%" update -Self
echo NuGet tools update completed.
) else (
echo Not update NuGet tools.
)
echo NuGet Start ReStoreing...
"%NuGetExe%" %NuGetArgs%
echo NuGet ReStore completed.
) else (
echo Not use NuGet tools.
)echo Start publishing...
"%MSBuildExe%" %MSBuildArgs% "%ProjectFile%"
echo Publish completed.

 

感谢伟大的stackoverflow论坛,给我提供了很多帮助。

答案来自于:

https://stackoverflow.com/questions/15053915/how-to-get-rid-of-solutiondir-when-building-vs-project-from-outside-visual

 

转载于:https://www.cnblogs.com/VAllen/p/how-to-get-rid-of-solutiondir-when-building-vs-project-from-outside-visual.html

http://www.lbrq.cn/news/2475379.html

相关文章:

  • 韶关网站建设第一品牌技术短期培训班
  • 网站建好了 怎么建后台企业如何建立网站
  • 校园网站建设报告网页制作作业100例
  • 网站两边横幅怎么做5月新冠病毒最新消息
  • 电商网站开发图书下载百度导航app
  • 华艺网站建设重庆森林电影完整版
  • 如何做网站关键字优化备案查询网
  • 石河子网站建设公司常见的网络推广方式有哪些
  • 公司做网站的费用入账seo优化技术是什么
  • wordpress导入用户数据库引擎优化是什么工作
  • 个人域名怎么申请seo观察网
  • 关于做网站的策划方案长春网站优化指导
  • 怎样用h5做网站产品推广营销方案
  • 网站怎么看是谁做的百家号排名
  • 如何做淘宝优惠卷网站网络营销教材电子版
  • 临安市建设局门户网站爱站seo工具
  • 织梦做网站首页青岛网站seo诊断
  • 淘宝里网站建设公司可以吗宁波seo优化公司
  • 贵州建设官方网站百度关键词排名点击
  • 台州网站建设自己代理一款手游需要多少钱
  • 沈阳网站建设与维护合肥网站制作公司
  • wordpress 添加手机号seo软件定制
  • 全国中高风险地区最新名单上海seo
  • 购物网站建设成本武汉seo学徒
  • 襄阳蒂凯网络网站建设小程序整站优化方案
  • 余姚网站设计平台免费的外贸b2b网站
  • 长春免费建站专业做网站官网
  • 临沂网站制作公司6seo外链优化
  • 营销型网站建设电子书seo外链工具
  • 重庆企业网站建设公司2021最火关键词
  • GitHub的免费账户的存储空间有多少?
  • 数据库索引详解:原理、设计原则与应用场景
  • 图片查重从设计到实现(5)Milvus可视化工具
  • almalinux9.6-4070显卡-ollama-qwen2.5-7b
  • 图片查重从设计到实现(4)图片向量化存储-Milvus 单机版部署
  • Git指令