激活实现SpFeaturereceiver的功能时访问拒绝? -- feature-activation 领域 和 access-denied 领域 和 site-settings 领域 sharepoint 相关 的问题

Access Denied when activating features implementing SPFeatureReceiver?


简体版||繁體版
0
vote

问题

中文

我们开发了几种实现SpFeatureCeiver接口的功能。当在开发环境中尝试它时,首先失败,直到我找到来自msdn 的脚本:

  function Set-RemoteAdministratorAccessDenied-False()  {      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null       # get content web service      $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService      # turn off remote administration security      $contentService.RemoteAdministratorAccessDenied = $false      $contentService.Update()           }   Set-RemoteAdministratorAccessDenied-False   

运行脚本并重置IIS后,它都在开发中工作得很好,我们可以在 Site Settings > Manage Site Features 中激活 99887661 的功能 http://mysolution/_layouts/managefeatures.aspx?scope = site 。激活后,我们再次将属性RemoteadMinistratorAccessDened逆转到True,并进行了新的 IISRESET

在生产服务器上,我们在部署该功能后使用相同的过程:

  1. 将RemoteadMinistratorAccessDened DED为FALSE
  2. iisreset并尝试激活功能 - 但它失败了。

我们回来的错误消息如下:

      Server Error in '/' Application. --------------------------------------------------------------------------------  Security Exception  Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.   Exception Details: System.Security.SecurityException: Access Denied.  Source Error:   The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:    <%@ Page Language="C#" Debug="true" %>  or:  2) Add the following section to the configuration file of your application:  <configuration>    <system.web>        <compilation debug="true"/>    </system.web> </configuration>  Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.  Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.    Stack Trace:    [SecurityException: Access Denied.]    Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate() +27451643    Microsoft.SharePoint.Administration.SPJobDefinition.Update() +152    Company.IssueTracker.Features.NewIssueTimerJob.NewIssueTimerJobEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties) +837    Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) +25671814    Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce) +25676799    Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) +27776095    Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, String featureName, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope) +150    Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope) +83    Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, SPFeatureDefinitionScope featdefScope) +699    Microsoft.SharePoint.WebControls.FeatureActivatorItem.BtnActivateFeature_Click(Object objSender, EventArgs evtargs) +140    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11058199    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11057738    System.Web.UI.Page.ProcessRequest() +91    System.Web.UI.Page.ProcessRequest(HttpContext context) +240    ASP._layouts_managefeatures_aspx.ProcessRequest(HttpContext context) +9    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171     -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4963; ASP.NET Version:2.0.50727.4971    

我的环境:SharePoint Server 2010

SharePoint 2007中的问题:

  • 在编程添加Web应用程序的功能时拒绝访问>
  • 错误激活功能
英文原文

We've developed several features who implement the SPFeatureReceiver interface. When trying this out in the development environment it first failed until I found this script from the MSDN:

function Set-RemoteAdministratorAccessDenied-False()  {      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null       # get content web service      $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService      # turn off remote administration security      $contentService.RemoteAdministratorAccessDenied = $false      $contentService.Update()           }   Set-RemoteAdministratorAccessDenied-False 

After running the script and reset IIS, it all worked well on development and we could activate the feature (as Farm Admin) in Site Settings > Manage Site Features with the scope set to Site http://mysolution/_layouts/ManageFeatures.aspx?Scope=Site. After activation we reversed the property RemoteAdministratorAccessDenied to true again, and did a new IISRESET.

On the production server, we used the same procedure after deployment of the feature:

  1. Set RemoteAdministratorAccessDenied to false
  2. IISRESET and tried to activate the feature - but it failed.

The error message we got back is the following:

    Server Error in '/' Application. --------------------------------------------------------------------------------  Security Exception  Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.   Exception Details: System.Security.SecurityException: Access Denied.  Source Error:   The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:    <%@ Page Language="C#" Debug="true" %>  or:  2) Add the following section to the configuration file of your application:  <configuration>    <system.web>        <compilation debug="true"/>    </system.web> </configuration>  Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.  Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.    Stack Trace:    [SecurityException: Access Denied.]    Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate() +27451643    Microsoft.SharePoint.Administration.SPJobDefinition.Update() +152    Company.IssueTracker.Features.NewIssueTimerJob.NewIssueTimerJobEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties) +837    Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) +25671814    Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce) +25676799    Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) +27776095    Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, String featureName, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope) +150    Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope) +83    Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, SPFeatureDefinitionScope featdefScope) +699    Microsoft.SharePoint.WebControls.FeatureActivatorItem.BtnActivateFeature_Click(Object objSender, EventArgs evtargs) +140    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11058199    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11057738    System.Web.UI.Page.ProcessRequest() +91    System.Web.UI.Page.ProcessRequest(HttpContext context) +240    ASP._layouts_managefeatures_aspx.ProcessRequest(HttpContext context) +9    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171     -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4963; ASP.NET Version:2.0.50727.4971  

My environement: Sharepoint Server 2010

Realated Questions in SharePoint 2007:

  • Access denied when adding web application features programmatically
  • Error activating feature
        

回答列表

1
 
vote
vote
最佳答案
 

如果博客,C.链接到没有帮助我试图使特征WebApplication范围内容可能是正确的,因为您添加了一个新的TimerJob。

我假设在特色中再次删除作业。在这种情况下,如果有人在两个网中激活该功能,则会出现问题,然后将其从其中一个删除。

 

If the blogs that C. linked to doesn't help I'd try to make the feature WebApplication scoped which probably is the right thing as you're adding a new timerjob.

I assume that in FeatureDeactiving you remove the job again. In that case you'll have a problem if someone activates the feature in two Webs and then remove it from one of them.

 
 
1
 
vote

我相信你的问题已经解决了吗? 在尝试时提供访问拒绝的事件接收器所以设置了WebApplication属性 此处在此进一步解释为 http://blog.bugraphostaci.com/tag/remoteadministratorAccessdenied/

希望它有所帮助, C: Marius

 

I believe your problem is already tackled here? FeatureActivated event receiver giving access denied when trying so set WebApplication property and the issue is further explained here http://blog.bugrapostaci.com/tag/remoteadministratoraccessdenied/

Hope it helps, C:\Marius

 
 

相关问题

2  用于访客用户的自定义搜索页面  ( Custom search page for guest users ) 
我重新配置了我的SharePoint在线站点集合(通信模板)以使用自定义搜索结果页面和不同的搜索中心URL。 在网站集管理局&gt; 搜索设置 I启用了选项将查询发送到自定义结果页面URL。并将我的URL放入结果页面URL 。我也将 search center url 设置为我的自定义URL。 为搜索设置在"站点管理...

0  激活实现SpFeaturereceiver的功能时访问拒绝?  ( Access denied when activating features implementing spfeaturereceiver ) 
我们开发了几种实现SpFeatureCeiver接口的功能。当在开发环境中尝试它时,首先失败,直到我找到来自msdn 的脚本: function Set-RemoteAdministratorAccessDenied-False() { [System.Reflection.Assembly]::L...

0  自定义主题“跟随链接”似乎不适用于站点上的每个链接  ( Custom theme followed link seem to not be applied on every link on the site ) 
客户不希望在SharePoint站点上访问访问和未访问的链接之间的任何区别。我将"跟随链接" 颜色设置为与链接颜色相同,但这似乎没有工作。 如果我在网站上访问任何WebPart,它的名称(带有链接当然)仍然以默认的"链接" 颜色显示。 我可以以任何方式覆盖这一点吗? ...

2  “rootelobly”属性的定制只在沙箱解决方案中使用?为什么?  ( Rootwebonly property of a customaction only works in sandboxed solutions why ) 
我有一个web应用程序范围的功能,这些功能会提供多个网站集合和子区域。 该功能还包含一个导航元素,它将新的自定义操作组添加到"站点设置" 页面。我想要的是,只需在网站集的rootweb的设置页面上显示该自定义组(类似于'网站集管理程序的组)。 我的方法是为组中的每个定制使用'rootwobonly ="true" '...

0  SharePoint 2013中丢失的站点导航设置  ( Site navigation setting lost in sharepoint 2013 ) 
我想在我的顶级导航栏中添加一些链接,所以我去了网站设置,但在网站导航设置中我没有看到我的链接的任何框。 我不知道发生了什么 ...

0  如何在网站设置页面上创建新页面,网站集管理部分?  ( How can i create a new page on site settings page site collection administratio ) 
如何在网站设置页面上创建新页面,网站集管理部分? 我已经知道如何在中央管理局上做到这一点,但如何在本节中完成每个网站集管理? ...

0  SharePoint Top Link Bar选项卡颜色和网站页面  ( Sharepoint top link bar tab color site pages ) 
我有问题是"顶部链接栏" 导航。顶部链接栏中有一定数量的标签,其中网站页面后面。 只有第一个选项卡颜色蓝色(主页选项卡)。如果我导航到页面,我希望将正确的标签为蓝色。 我激活了发布功能,以便收到额外的导航设置菜单。 我读取如果您使用相对网址,如果您在链接到它的页面上,则使用相对网址颜色为蓝色,我尝试过这一点但不成功...

0  站点导航设置停止响应  ( Site navigation settings stop responding ) 
我和其他实习生正在为我们的主机公司的Intranet站点工作,我们的导航设置页面已停止正常工作。 一旦选择危险区域中的项目,页面完全冻结。恢复它的唯一方法是使用IE内置恢复工具。 背景:页面的最后一个变化涉及将"部门人力资源" 按钮移动并隐藏。 我设法在创建一个新的标题"当前导航" 之外的新标题后获得临时完全控制...

4  Term Store Management选项在网站集设置中缺少  ( Term store management option missing in site collection settings ) 
我在网站集合设置中没有看到"术语存储管理" 。我检查了这个博客文章 http://blog.petergerritsen.nl/2010/06/09/term-store-management-option-missing-in-site-collection-settings/ 这建议激活我尝试的特征但是我仍然没有...

3  SharePoint 2013在线 - 缺少网站设置?  ( Sharepoint 2013 online missing site settings ) 
我是一个网站集管理,但由于某种原因,我的网站设置菜单缺少这些菜单项: 网页设计师画廊 网站列 网站内容类型 网页零件 列表模板 主题 解决方案 组成的外观 网站收集管理 html字段安全 SharePoint Designer Settings 为什么我看不到这些菜单的任何想法? ...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有