Die AppParts, die Microsoft in der neuesten Version von SharePoint eingeführt haben, erfordern eine spezielle Konfiguration der Entwicklungsumgebung. Eine kleine Übersicht:
Voraussetzungen
SP 2013 (in folgendem SP genannt)
Visual Studio 2012 (in folgendem VS genannt)
Einrichten der Templates in Visual Studio
Damit die Templates für SP- und Officeprojekte in VS verfügbar sind, müssen die Office 2012 Entwicklertools installiert werden. Dafür müssen wir als
-
den Micorsoft Web Plattform Installer herunterladen und installieren.
Nachdem man diesen im
-
Schritt gestartet hat,
muss man im
Als
-
die Tools installieren.
Anschließend sollten die Templates in VS vorhanden sein.
Einrichten der SP Entwicklungsumgebung
Damit man eine SP-Hosted App ausrollen kann, muss man eine Isolated AppDomain einrichten. Dies ist in diesem MSDN Artikel ausführlich beschrieben.
Das benötigte Script noch einmal zusammengefasst (in der SP PowerShell Konsole als Administrator ausführen):
- $username = “yourdomain\youruser”
- $appDomain = “appdev.SharePoint.dev.hansevision.de”#this value can be adjusted for your needings
- #1.Ensure that the spadmin and sptimer services are running by opening a command prompt and typing the following commands.
- net start spadminv4
- net start sptimerv4
- #2.Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command.
- Set-SPAppDomain $appDomain
- #3.Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell.
- Get-SPServiceInstance | where{$_.GetType().Name -eq “AppManagementServiceInstance” -or $_.GetType().Name -eq “SPSubscriptionSettingsServiceInstance”} | Start-SPServiceInstance
- #4.Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running by typing the following command in the SharePoint Management Shell. The output will indicate whether each service is online.
- Get-SPServiceInstance | where{$_.GetType().Name -eq “AppManagementServiceInstance” -or $_.GetType().Name -eq “SPSubscriptionSettingsServiceInstance”}
- #5.You must specify an account under which the SPSubscriptionService and AppManagementServiceInstance service instances will run. This account must be an SPManagedAccount. You can create an SPManagedAccount by typing the following command in the SharePoint Management Shell. (You’ll be prompted for the account domainuser and password.)
- $account = New-SPManagedAccount
- #6.Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services by typing the following code in the SharePoint Management Shell. If you created a SPManagedAccount in the preceding step, use that account name here.
- $account= Get-SPManagedAccount $username
- $appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
- $appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
- $appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB
- $proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
- $appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
- $proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
- #7.Specify your tenant name by typing the following code in the SharePoint Management Shell.
- Set-SPAppSiteSubscriptionName -Name “app” -Confirm:$false
Um die AppParts aufrufen zu können, muss man noch den Loopback Check ausschalten.
Mehr dazu > DisableLoopbackCheck
Nun sollte das AppPart auf den Server rollen und dort aufrufbar sein können
Pingback: SharePoint 2013 — Schritte zum Entwickeln des ersten AppParts in Visual Studio 2012 - SharePoint Blogs in German - Bamboo Nation