SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need some information regarding the PowerShell commands. I have created one WSP, and while installing that WSP I need to add -WebApplication.(It's mandatory some times / some times not) So what factor/source is causing to force the command to add the -WebApplication in the install command.

Some times I don't need to add the -WebApplication.

Install-SPSolution -Identity Test.wsp  -WebApplication http://pc07:0707 -GACDeployment
share|improve this question
up vote 4 down vote accepted

Solution can be deployed into two different levels:

  • farm
  • web application

Prior to the actual installation, SharePoint tries to determine if your particular .wsp contains resources, scoped to web application. If you solution does contain such resources, you need to use -WebApplication switch.

Which types of resources (or deployment artifacts) are considered by SharePoint as web application scoped:

  • Web application scoped features
  • Safe control entries (because in that case SharePoint needs to update web.config for corresponding web application)
  • .dll deployed to the bin folder
  • May be some other elements
share|improve this answer
    
Can you please elaborate it? Which .dll's goes in the Web Application Scope? – Ram 4 hours ago
    
When dealing with code inside SharePoint solution, you can deploy your dll into the GAC (most common option) or into the web application's bin folder. Each web application in sharepoint is mapped to corresponding IIS web site, that means that your dlls will reside under bin folder for IIS web site, ie `c:\inetpub\wwwroot\wss\VirtualDirectories\Portal-80\bin`. Code inside bin directory is less trusted, that's why usually you put into the GAC – Kai 4 hours ago

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.