首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >企业库4.1记录sharepoint web.config引发的错误?

企业库4.1记录sharepoint web.config引发的错误?
EN

Stack Overflow用户
提问于 2011-11-10 22:15:50
回答 1查看 1.2K关注 0票数 0

我试图在Sharepoint 2007 (MOSS)中使用企业库4.1。在我只使用sharepoint中的企业数据应用程序之前,它运行良好。我刚开始使用日志,还抛出站点,没有相关的异常。

web.config

在配置部分

代码语言:javascript
复制
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.
 Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    requirePermission="true" />

安全控制部分

代码语言:javascript
复制
<SafeControl Assembly="Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity" TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.Unity" TypeName="*" Safe="True" />
<SafeControl Assembly="Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="Microsoft.Practices.EnterpriseLibrary.Logging" TypeName="*" Safe="True" />

测井配置段

代码语言:javascript
复制
 <loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
    <listeners>
      <add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        source="Enterprise Library Logging" formatter="Text Formatter"
        log="SPE SharePoint Event Log" machineName="." traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
      <add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        fileName="rolling.log" formatter="Text Formatter" rollInterval="Day"
        traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
    </listeners>
    <formatters>
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="General">
        <listeners>
          <add name="Event Log Listener" />
          <add name="Rolling Flat File Trace Listener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events">
        <listeners>
          <add name="Event Log Listener" />
        </listeners>
      </allEvents>
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Rolling Flat File Trace Listener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>

在大会组

代码语言:javascript
复制
    <add assembly="Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

页面显示了不同的错误。

代码语言:javascript
复制
This page has encountered a critical error. Contact your system administrator if this problem persists. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Microsoft.SharePoint.WebPartPages.WebPartPageUserException: This page has encountered a critical error. Contact your system administrator if this problem persists.

Source Error: 


Line 254:
Line 255:
Line 256:    <WebPartPages:ContentEditorWebPart ID="ContentEditorWebPart2" runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="BBAABEB8-E66E-48ec-AB3B-CB0AD46757B3" >
Line 257:<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
Line 258:  <Title>Click the link below to manage your groups:</Title>


Source File: c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\MYSPE\TabsUserCotrol.ascx    Line: 256 

Stack Trace: 


[WebPartPageUserException: This page has encountered a critical error. Contact your system administrator if this problem persists.]
   Microsoft.SharePoint.ApplicationRuntime.SafeControls.RethrowExceptionIfNeeded() +43
   Microsoft.SharePoint.ApplicationRuntime.SafeControls.IsSafeControl(Type type, String& unsafeErrorMessage) +52
   Microsoft.SharePoint.WebPartPages.TypeCache.get_Item(Type type) +144
   Microsoft.SharePoint.WebPartPages.EmbeddedXmlReader..ctor(TextReader reader, Type type, SPWeb spWeb) +106
   Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj) +990
   System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(Object obj) +10
   ASP._controltemplates_myspe_tabsusercotrol_ascx.__BuildControlContentEditorWebPart2() in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\MYSPE\TabsUserCotrol.ascx:256
   ASP._controltemplates_myspe_tabsusercotrol_ascx.__BuildControl__control13(Control __ctrl) in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\MYSPE\TabsUserCotrol.ascx:238
   System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
   System.Web.UI.WebControls.WebParts.WebPartZone.GetInitialWebParts() +106
   System.Web.UI.WebControls.WebParts.WebPartManager.RegisterZone(WebZone zone) +186
   System.Web.UI.WebControls.WebParts.WebZone.OnInit(EventArgs e) +95
   System.Web.UI.WebControls.WebParts.WebPartZone.OnInit(EventArgs e) +9

,如果我从web.config中删除上面的代码,那么站点就可以正常工作了。我不知道我失踪了什么地方。

请你帮我找到解决办法。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-15 14:19:45

您可以删除企业库的SafeControl区段条目和程序集区段条目。我觉得你根本不需要这些。我使用过EntLib2.0/SharePoint2007和EntLib5.0/SharePoint2010,而且在我的web.config中从未使用过这些部分。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8087118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档