2009-03-11 10 views
2

Komut satırından yerel olarak çalıştırdığımda, bir konsol uygulaması oluşturdum. Ve bir yerel dosyaya kaydeder.UNC yolunu kullanarak exe çalıştırdığınızda Microsoft.Practices.EnterpriseLibrary ile kısmen güvenilir arayanlar hatası alıyorsunuz?

ben başka bir makineye kopyalamak ve komut satırı

yani

//AnotherServer/d$/Apps/MyExe 

bu hatayı alıyorum gelen çalıştırmayı denediğinizde.

An error occurred creating the configuration section handler for loggingConfiguration: That assembly does not allow partially trusted callers. 

Benim App.config

<configSections> 
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    </configSections> 
    <loggingConfiguration name="Logging Application Block" tracingEnabled="true" 
    defaultCategory="General" logWarningsWhenNoCategoriesMatch="true"> 
    <listeners> 
     <add source="Enterprise Library Logging" formatter="Text Formatter" 
     log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     name="Formatted EventLog TraceListener" /> 
     <add fileName="c:\Logs\UnzipEmailAttachment.log" rollSizeKB="0" timeStampPattern="yyyy-MM-dd" 
     rollFileExistsBehavior="Increment" rollInterval="Day" formatter="Text Formatter" 
     header="----------------------------------------" footer="----------------------------------------" 
     listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     traceOutputOptions="Timestamp" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     name="Rolling Flat File Trace Listener" /> 
    </listeners> 
    <formatters> 
     <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}" 
     type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     name="Text Formatter" /> 
    </formatters> 
    <categorySources> 
     <add switchValue="All" name="General"> 
     <listeners> 
      <add name="Formatted EventLog TraceListener" /> 
      <add name="Rolling Flat File Trace Listener" /> 
     </listeners> 
     </add> 
    </categorySources> 
    <specialSources> 
     <allEvents switchValue="All" name="All Events" /> 
     <notProcessed switchValue="All" name="Unprocessed Category" /> 
     <errors switchValue="All" name="Logging Errors &amp; Warnings"> 
     <listeners> 
      <add name="Formatted EventLog TraceListener" /> 
      <add name="Rolling Flat File Trace Listener" /> 
     </listeners> 
     </errors> 
    </specialSources> 
    </loggingConfiguration> 
    <exceptionHandling> 
    <exceptionPolicies> 
     <add name="GeneralExceptionPolicy"> 
     <exceptionTypes> 
      <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
      postHandlingAction="NotifyRethrow" name="Exception"> 
      <exceptionHandlers> 
       <add logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling" 
       formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
       priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
       name="Logging Handler" /> 
      </exceptionHandlers> 
      </add> 
     </exceptionTypes> 
     </add> 
    </exceptionPolicies> 
    </exceptionHandling> 

hatayı açıklayabilir ve nasıl düzeltmek için içerir? Diğer makinede bir ağ sürücüsünden çalıştırıyorsanız

cevap

1

o ağ sürücüsü giderek güvenim tamdır izin verebilir: Denetim Masası> İdari Araçlar-> Microsoft .Net Framework Konfigürasyon> Benim Bilgisayar -> Süre Güvenlik Politikası -> Makine -> Kod Grupları -> All_Code -> Yerel Intranet bölgesi

Ardından üyelik koşulu izin vermek istediğiniz ağ sürücüsü olmak ile yeni bir ilke oluşturmak. Ayrıca all_code level

'da yeni bir politika eklemeniz gerekebilir.
İlgili konular