Deployment SharePoint 2010:尝试使用power shell安装web部件时出现问题

Deployment SharePoint 2010:尝试使用power shell安装web部件时出现问题,deployment,sharepoint-2010,web-parts,Deployment,Sharepoint 2010,Web Parts,我正试图在2010年部署我的第一个web部件。我使用VS2008开发了一个web部件,并在SP2007上进行了测试 我将CAB复制到2010服务器,并尝试使用power shell安装它: PS C:\Users\sa_portalt> Install-SPWebPartPack -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart" Install-SPWebPartPack : Pa

我正试图在2010年部署我的第一个web部件。我使用VS2008开发了一个web部件,并在SP2007上进行了测试

我将CAB复制到2010服务器,并尝试使用power shell安装它:

PS C:\Users\sa_portalt> Install-SPWebPartPack -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
Install-SPWebPartPack : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:22
+ Install-SPWebPartPack <<<<  -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
    + CategoryInfo          : InvalidArgument: (:) [Install-SPWebPartPack], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.SharePoint.PowerShell.SPCmdletInstallWebPartPack
PS C:\Users\sa\u portalt>安装SPWebPartPack-LiteralPath“C:\transfer\webparts\redirectwebpart.cab”-名称“redirectwebpart”
安装SPWebPartPack:无法使用指定的命名参数解析参数集。
第1行字符:22

+如果可以,请安装SPWebPartPack,我建议您升级到Visual Studio 2010,它内置了对SharePoint 2010的支持。当您从SharePoint模板生成项目时,它将为您创建wsp。您还可以立即从VS2010部署到本地服务器,这样您就无需进入本地开发机器上的PowerShell

当需要部署到其他服务器时,可以运行

Add SPSolution-LiteralPath C:\webparts\MyWebPart.wsp
将解决方案添加到管理中心 然后


安装SPSolution-Identify MyWebPart.wsp-WebApplication
要将解决方案部署到指定的web应用程序

如果可以,我建议您升级到Visual Studio 2010,它内置了对SharePoint 2010的支持。当您从SharePoint模板生成项目时,它将为您创建wsp。您还可以立即从VS2010部署到本地服务器,这样您就无需进入本地开发机器上的PowerShell

当需要部署到其他服务器时,可以运行

Add SPSolution-LiteralPath C:\webparts\MyWebPart.wsp
将解决方案添加到管理中心 然后


Install SPSolution-Identify MyWebPart.wsp-WebApplication
将解决方案部署到指定的web应用程序

这是我找到的第一篇提供实际答案的文章,但是,在Install SPSolution中,有一个typeo,-Identify参数应该是-Identify

此外,在大多数情况下(如果添加到GAC中),需要将-GACDeployment添加到Install SPSolution中

所以这条线应该是这样的:
安装SPSolution-Identity BasicWebPart.wsp-WebApplication-GACDeployment

这是我找到的第一篇提供实际答案的文章,但是,在安装SPSolution中,有一个typeo,-identify参数应该是-Identity

此外,在大多数情况下(如果添加到GAC中),需要将-GACDeployment添加到Install SPSolution中

所以这条线应该是这样的:
安装SPSolution-Identity-BasicWebPart.wsp-WebApplication-GACDeployment

目前我们仍在关注SP2007。我正在使用SP2010进行初始测试,只想调查我们web部件的迁移情况。我们还没有VS2010。目前我们的重点仍然是SP2007。我正在使用SP2010进行初始测试,只想调查我们web部件的迁移情况。我们还没有VS2010。