如何使用命令行构建 SharePoint 2010 包? [英] How can I build a SharePoint 2010 package using command line?

查看:22
本文介绍了如何使用命令行构建 SharePoint 2010 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Visual Studio 2010 SharePoint 项目.如果我从项目菜单中选择Package",则会生成一个 .wsp 文件.如何从命令行调用相同的构建(即 MSBuild 需要什么/target)?

I have a Visual Studio 2010 SharePoint project. If I choose 'Package' from the project menu, a .wsp file is generated. How can I invoke the same build from command line (i.e. what /target is required for MSBuild)?

推荐答案

我终于开始工作了.棘手的部分是当 MSBuild 加载 .sln 文件时 SharePoint 目标不存在,您必须加载单个 .csproj 文件.

I got it to work, finally. The tricky part is the fact that the SharePoint targets do not exist when MSBuild loads the .sln file, you have to load the individual .csproj files.

set msbuild="C:WINDOWSMicrosoft.NETFrameworkv4.0.30319MSBuild.exe"
set config=Debug
set outdir="C:out"
%msbuild% /p:Configuration=%config% /m ../My.SharePoint.Project/My.SharePoint.Projectcsproj /t:Package /p:BasePackagePath=%outdir%

这篇关于如何使用命令行构建 SharePoint 2010 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆