如果添加到项目/ Properties / PublishProfiles /<之外的任何位置,Msbuild(C:\Program Files(x86)\ Microsoft Visual Studio\2017 \ Communmunity \ MSBuild \15.0 \ Bin)将忽略Pubxml文件。 FolderProfile.pubxml> [英] Msbuild (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin) ignores Pubxml file if added to any location other than project /Properties/PublishProfiles/<FolderProfile.pubxml>
问题描述
我正在尝试使用 C:\ Program Program(x86)\ Microsoft Visual Studio \\\ 2017 \\ Communmunity\MSBuild\15.0\Bin\MSbuild.exe
i am trying to Publish .Net Core application using C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSbuild.exe
这是命令
$ msbuildExe =" C:\\ \\ Program Program(x86)\ Microsoft Visual Studio\2017 \Community\MSBuild\15.0\Bin\MSBuild.exe"
$msbuildExe = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
$ filePath = "C:\Projects \CorePublicApi \src \DeveloperPortal \DeveloperPortal \DeveloperPortal.csproj"
$
$ pxmlUID =" XXXXXXXXX"
$ pxmlPWD =" XXXXXXXXX"
$ pxmlPath =" C:\ Test \ Base.pubxml"
& $ msbuildExe $ filePath,'/ p:DeployOnBuild = true'," / p:PublishProfile = $ pxmlPath"," / p:Username = $ pxmlUID"," / p:Password = $ pxmlPWD",'/ p:Configuration =发布','/ p:AllowUntrustedCertificate = True','/ p:WarningLevel = 0','/ p:verbosity = quiet',
'/ p:MvcBuildViews = false'
$filePath = "C:\Projects\CorePublicApi\src\DeveloperPortal\DeveloperPortal\DeveloperPortal.csproj"
$pxmlUID="XXXXXXXXX"
$pxmlPWD="XXXXXXXXX"
$pxmlPath = "C:\Test\Base.pubxml"
&$msbuildExe $filePath, '/p:DeployOnBuild=true',"/p:PublishProfile=$pxmlPath","/p:Username=$pxmlUID", "/p:Password=$pxmlPWD", '/p:Configuration=Release', '/p:AllowUntrustedCertificate=True', '/p:WarningLevel=0', '/p:verbosity=quiet',
'/p:MvcBuildViews=false'
正如您所看到的,我希望MSbuild从上面给出的位置获取PubXml文件(ieC:\ Test \ Base.pubxml),但它会被忽略,MSBuild会发布到默认位置。
As you can see i am expecting MSbuild to fetch PubXml file from the location given above(i.e.C:\Test\Base.pubxml ), but it gets ignored and MSBuild publish to default location.
但是当我在项目根位置创建文件夹结构Properties / PublishProfiles并将此pubxml文件添加到此位置时,MSbuild会识别出这一点并且按预期工作。
However when i create the folder structure Properties/PublishProfiles in the project root location and add this pubxml file to this location MSbuild does recognize this and works as expected.
所有我需要的是MSBuild应该能够从我指定的任何位置获取PubXml。
All i require is MSBuild should be able to fetch PubXml from any location i specify.
我做错了什么?请指导。
Am i doing anything wrong? Please guide.
谢谢
推荐答案
仅当我们尝试发布.NetCore应用程序时才会出现此行为。我们应该如何提供publxml路径?
This behavior is only when we are trying to publish .NetCore application. How are we supposed to provide publxml path ?
这篇关于如果添加到项目/ Properties / PublishProfiles /<之外的任何位置,Msbuild(C:\Program Files(x86)\ Microsoft Visual Studio\2017 \ Communmunity \ MSBuild \15.0 \ Bin)将忽略Pubxml文件。 FolderProfile.pubxml>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!