Is there anyway I can build .wsp file using MSBuild target?

I am able to pass t:/Package to msbuild.exe but can I pass it MSBuild target too?

Do I need to use MAKECAB.exe? I hope not..

  • 2
    What is it that you are attempting to do that is not handled by the built-in WSP tools? – Dave Wise Mar 1 '13 at 19:45

Visual Studio creates the WSP at build since it includes this in the CSPROJ file:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" />

That does a lot of work to validate the project and such before creating a WSP file.

If you simply build the project with msbuild, the WSP should be output to the release or debug directory (depending on your build target). If you need to do something with it after it builds, you can reference that location. In addition, you could always add a post-build event that does something with the file if you need it to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.