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

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

问题描述

我有一个Visual Studio 2010 SharePoint项目.如果从项目菜单中选择包",则将生成一个.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:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.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天全站免登陆