我有下面的机器OS: Windows server 2016 SharePoint: 2016 Visual : 2015 Professional
当我们使用Visual发布任何sharepoint项目时,它都会生成.wsp文件,但是当我们尝试使用msbuild生成相同的文件时,只生成.dll,而不生成.wsp文件。
尝试从框架(在下面的代码中引用msbuild.exe )和程序文件(在下面的代码中引用msbuild_2)
set msbuild_1 ="C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
set msbuild_2 ="C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe"
set config=Release
set outdir2=C:\out\
rd /S /Q "%outdir2%"
%msbuild_1% /p:Configuration=%config% /m "C:\Test\test.csproj" /t:Package /p:BasePackagePath=%outdir2%
%msbuild_2% /p:Configuration=%config% /m "C:\Test\test.csproj" /t:Package /p:BasePackagePath=%outdir2%两个版本的msbuild.exe都只生成.dll,而不生成.wsp。
我们是否可以从.wsp或powershell生成msbuild.exe文件?
发布于 2022-06-28 05:09:58
如果您想使用Msbuild创建一个共享点包,可以参考以下步骤:
还可以参考此页,了解如何使用命令行MSBuild任务构建、清理和验证sharepoint包。
发布于 2022-07-03 12:08:25
更改路径后,在PowerShell中运行以下命令
$msbuildpath = ""
$csprojpath = ""
$OutputPath = ""
$vsversion = "14.0"
cd $msbuildpath
.\msbuild.exe $csprojpath /p:IsPackaging=true /p:OutputPath="$OutputPath" /p:Configuration=Release /p:VisualStudioVersion=$vsversion /t:Package输出将包括WSP文件。
https://stackoverflow.com/questions/72770954
复制相似问题