我有一个简单的 SharePoint 项目,其中包含一个场范围的功能。该功能不包含任何模块;它只是SPClaimProviderFeatureReceiver
指派生类,而派生类又指向SPClaimProvider
派生类。
当我告诉项目进行部署时,它确实成功地将程序集添加到 GAC,并在 中的文件夹中成功创建 Feature.xml C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES
,并提供以下输出:
------ 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 界面中单击部署时,它显示“解决方案已成功部署”(为什么 VS 不这样做??)。但在那之后,该功能仍然没有出现。