我正在更新一些VS SharePoint项目,因此在构建它们时,会同时创建dll和wsp(包)。创建SharePoint包之前运行的Visual Studio后构建命令
我发现this页描述的过程,但问题是,虽然我的项目文件看起来像这样:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);CreatePackage</BuildDependsOn>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>"$(SolutionDir)PostBuild.cmd" "$(SolutionDir)" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
PostBuild.cmd运行前发生的包装,所以开始清理时,这是输出:
------ Rebuild All started: Project: Sample, Configuration: Debug Any CPU ------
SampleProject -> C:\Inter\bin\Debug\Sample.dll
C:\Inter\bin\Debug\Sample.dll
1 File(s) copied
File not found - *.wsp
0 File(s) copied
Successfully created package at: C:\Inter\Sample\bin\Debug\Sample.wsp
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
任何想法?谢谢!!!
当然......什么,我在这里发帖是PostBuild发生创建包... – Ariel 2011-04-06 11:45:39
@Ariel BEFORE:我想告诉你,这是正确的行为。如果你想在打包之前做任何事情,可以使用PreDeploymentCommand – vvk 2011-04-06 12:23:32
但是我不想做部署,只打包AFTER build和BEFORE PostBuild事件,有意义吗?我想单击“重建”,并建立项目,打包,然后postbuild命令运行... – Ariel 2011-04-06 12:42:28