“安装 SharePoint 应用程序”中出现错误: 未在此网站上启用应用程序的旁加载 解决方法

SharePoint 2013 App开发的过程中,部署的时候提示“未在此网站上启用应用程序的旁加载”,




错误 1 部署步骤“安装 SharePoint 应用程序”中出现错误: 未在此网站上启用应用程序的旁加载。
0 0SharePointApp1
                "Sideloading of apps is not enabled on this site" 


 解决方法:
  1、下载http://www.microsoft.com/en-us/download/details.aspx?id=30359
  2、把下面脚步存为luozhuang.ps1
  3、Powershell运行
  4、运行时候
Site Url 填入你SharePoint 网站地址  
User Name 填入微软账号
Password  填入微软账号密码
成功以后 重新启动计算机,运行 VS2012 Ok


#CODE STARTS HERE

$programFiles = [environment]::getfolderpath("programfiles")

add-type -Path $programFiles'\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'

Write-Host 'To enable SharePoint app sideLoading, enter Site Url, username and password'
  
 $siteurl = Read-Host 'Site Url'
  
 $username = Read-Host "User Name"
  
 $password = Read-Host -AsSecureString 'Password'
  
 if ($siteurl -eq '')
 {
     $siteurl = 'https://mytenant.sharepoint.com/sites/mysite'
  
     $username = 'me@mytenant.onmicrosoft.com'
  
     $password = ConvertTo-SecureString -String 'mypassword!' -AsPlainText -Force
  
 }
      $outfilepath = $siteurl -replace ':', '_' -replace '/', '_'
  
 try
 {
     [Microsoft.SharePoint.Client.ClientContext]$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
  
     [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  
     $cc.Credentials = $spocreds
     
      Write-Host -ForegroundColor Yellow 'SideLoading feature is not enabled on the site:' $siteurl
      
      $site = $cc.Site;
      
         $sideLoadingGuid = new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
      
         $site.Features.Add($sideLoadingGuid, $false, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
      
         $cc.ExecuteQuery();
      
         Write-Host -ForegroundColor Green 'SideLoading feature enabled on site' $siteurl
     #Activate the Developer Site feature
 }
  
 catch
  
 { 
     Write-Host -ForegroundColor Red 'Error encountered when trying to enable SideLoading feature' $siteurl, ':' $Error[0].ToString();
 }

#CODE ENDS HERE

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值