5

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

1 Answer 1

6

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
2
  • Can you please elaborate it? Which .dll's goes in the Web Application Scope?
    – Ram
    Nov 23, 2016 at 8:34
  • 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 Nov 23, 2016 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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