I'm updating some VS SharePoint projects so when they are built, both dll's and wsp's (packages) are created.
I found this page describing the process, but issue is that, while my project file looks like 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 is run BEFORE packaging happens, so when sta开发者_开发知识库rting clean, this is the output:
------ 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 ==========
Any ideas? Thanks!!!
Solution can be found here.
Visual Studio & SharePoint: how to create package as part of the build process In order to build a project and have the package created, this can be added to the project file (csproj, vbproj):
<PostBuildEventDependsOn>
$(PostBuildEventDependsOn);
CreatePackage;
</PostBuildEventDependsOn>
That's right. PostBuild event occurs after buiding assembly.
精彩评论