Domanda

Utilizziamo SP2013 e PowerShell per distribuire WSPS.

Quando si installa WSP tramite PowerShell:

Caso 1:

Add-SPSolution -LiteralPath $path
install-spsolution -Identity $solution  -GACDeployment
.

Sopra PowerShell distribuirà il WSP per il GAC sul server e distribuirà su tutti gli URL.

Caso 2:

Add-SPSolution -LiteralPath $path
install-spsolution -Identity $solution -WebApplication $oURL  -GACDeployment
.

Sopra PowerShell distribuisce il WSP al GAC sul server e distribuire solo su 1 applicazione Web specifica (non nella cartella Bin).

Caso 3:

How to deploy to the URL at bin folder on server?
.

Le mie domande qui sono: -

    .
  1. Caso 1 rende il wsp (dire WebPart) disponibile per ciascuna WebApplication on Server, che ne dici del caso 2? Dal momento che è schierato in 1 particolare Weburl, non sarà utilizzabile dalle altre app Web? Cos'è questo concetto?

  2. Per caso 3, si prega di fornire il codice PowerShell.

  3. Ho letto che: -

    Le soluzioni SharePoint sono implementate a livello globale o mirato a una particolare applicazione Web. La decisione di cui viene effettuata automaticamente dal framework della soluzione di SharePoint a seconda del contenuto del manifest della soluzione.

    Ma questo può essere anche controllato da PowerShell, non importa quale sia l'impostazione nella soluzione manifest, sono giusto?

È stato utile?

Soluzione

No, the solution dictates if it's global or per web application.

WebApp Scope
If the solution contains resources that's web application specific like:
- Dll deployed to bin
- Dll with SafeControls
- files to the other hostdir folders
then the solution must be installed to specific web application(s) by either specifying web applications like:

Install-SPSolution -Identity $solution -WebApplication $webApp

or by specifying that you want to deploy to all:

Install-SPSolution -Identity $solution -AllWebApplications

Global Scope
If there is no web application specific resources then it's installed globally using

Install-SPSolution -Identity $solution

How do I control if my dll goes to GAC or bin?
The placement of your dll(s) is controlled by the manifest.xml in the solution and is con trolled by the DeploymentTarget attribute of the <Assembly> element(s).

Here I deploy to GAC:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="3086e4c4-aa41-45a4-b2f2-6c0d3fddc99f" SharePointProductVersion="15.0">
  <Assemblies>
    <Assembly Location="Test.dll" DeploymentTarget="GlobalAssemblyCache">
    </Assembly>
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="Test_Feature1\Feature.xml" />
  </FeatureManifests>
</Solution>

And here to bin folder:

<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="3086e4c4-aa41-45a4-b2f2-6c0d3fddc99f" SharePointProductVersion="15.0">
  <Assemblies>
    <Assembly Location="Test.dll" DeploymentTarget="WebApplication">
    </Assembly>
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="Test_Feature1\Feature.xml" />
  </FeatureManifests>
</Solution>

As a developer you specify that in VS by selection your SharePoint Project in Solution Explorer and then in properties change Assembly Deployment Target:

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top