Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to deploy my first web part on 2010. I developed a web part using VS2008 and tested it on SP2007.

I copied the CAB to the 2010 server and tried to use PowerShell to install it and got the following error:

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

What am I doing wrong? Is this the right way to install web parts?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

For SharePoint 2010 development I would recommend upgrading to Visual Studio 2010 if possible, as the built-in tools make the whole testing and deployment a lot easier. Also, we name the cab files with the extension .wsp to make it clear that it is a solution package.

Assuming the solution package has been built correctly, the PowerShell script in your post seems to have been scrambled in the process of pasting it. You should be doing something like:

Add-SPSolution c:\transfer\webparts\WebPart.wsp

which will add the solution to your farm (configuration database), then

Install-SPSolution WebPart.wsp -GACDeployment -WebApplication http://server/

to deploy the solution to your web application.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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