2009-03-11 2 views
2

J'ai créé une application de console qui fonctionne correctement lorsque je l'exécute localement à partir de la ligne de commande. Et il se connecte à un fichier local.Obtention d'une erreur d'appel partiellement approuvée avec Microsoft.Practices.EnterpriseLibrary lors de l'exécution d'exe à l'aide du chemin d'accès UNC?

Lorsque je copie sur une autre machine et essayer de courir à partir de la ligne de commande

-à-dire

//AnotherServer/d$/Apps/MyExe 

Je reçois cette erreur.

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

Mon App.config contient

<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> 

Pouvez-vous expliquer l'erreur et comment résoudre?

Répondre

1

Si vous exécutez à partir d'un lecteur réseau sur l'autre machine, vous pouvez permettre à ce lecteur réseau d'avoir une confiance totale en allant à: Panneau de configuration> outils-> Microsoft .Net Framework administratif Configuration-> Mon informatique -> Runtime Politique de sécurité -> machine -> Groupes de code -> All_Code -> zone Intranet local

créez ensuite une nouvelle politique à la condition d'adhésion étant le lecteur réseau que vous souhaitez autoriser. Vous devrez peut-être également ajouter une nouvelle politique au niveau de tous les codes

Questions connexes