Visual Studio部署不会激活SharePoint功能

时间:2012-12-04 18:02:54

标签: sharepoint deployment claims-based-identity sharepoint-feature

我有一个简单的SharePoint项目,其中包含一个服务器场范围的功能。该功能不包含任何模块;它只是引用一个SPClaimProviderFeatureReceiver派生类,它又指向一个SPClaimProvider派生类。

当我告诉项目部署时,它会成功将程序集添加到GAC,并在C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES的文件夹中成功创建Feature.xml,并提供此输出:

------ Build started: Project: xxx, Configuration: Debug Any CPU ------
  xxx -> E:\xxx\bin\AnyCPU\Debug\xxx.dll
  Successfully created package at: E:\xxx\xxx.wsp
------ Deploy started: Project: xxx, Configuration: Debug Any CPU ------
Active Deployment Configuration: Default
Run Pre-Deployment Command:
  Skipping deployment step because a pre-deployment command is not specified.
Recycle IIS Application Pool:
  Skipping application pool recycle because no matching package on the server was found.
Retract Solution:
  Skipping package retraction because no matching package on the server was found.
Add Solution:
  Adding solution 'xxx.wsp'...
  Deploying solution 'xxx.wsp'...
Activate Features:
  No features in this solution were activated.
Run Post-Deployment Command:
  Skipping deployment step because a post-deployment command is not specified.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

部署的Feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
   Title="xxx"
   AutoActivateInCentralAdmin="TRUE"
   Description="xxx" 
   Id="063aae98-029f-4c01-a20e-15b6c8576bc8"
   ReceiverAssembly="xxx, Version=0.1.0.0, Culture=neutral, PublicKeyToken=6e7f8ba8e1265a7f"
   ReceiverClass="xxx" Scope="Farm" />

我担心它没有激活任何功能。 WSP确实显示在管理中心解决方案管理中,但表示“未部署”,并且该功能未显示在“管理服务器场功能”中。当我点击Web界面中的Deploy时,它会显示“解决方案已成功部署”(为什么VS没有这样做?)。但之后该功能仍然没有出现。

3 个答案:

答案 0 :(得分:1)

在VS解决方案资源管理器中,右键单击项目&gt;&gt;选择属性&gt;&gt;选择sharepoint选项卡 这里有不同的“主动部署配置”。确保从下拉列表中选择了适当的配置。您可以修改和查看每个配置的步骤。

答案 1 :(得分:0)

如果在将解决方案部署到sharepoint环境时遇到此类错误,请确保您的项目不是沙盒解决方案。

单击您的项目,转到Visual Studio中的属性窗口,并将Sandboxed Solution的值从true更改为false。重建项目并进行部署。

答案 2 :(得分:-2)

跳过部署前后命令只是一个警告,因为您没有为这些步骤指定任何命令。 在VS SharePoint选项卡中(请参阅Rahil关于如何到达的答案),您有2个用于编写前置和后置命令的文本框