2013-08-29 14 views
7

Sto creando un web ASP.NET che recupera e inserisce dati all'interno di CRM 2011. Tutto andava bene, la pagina veniva distribuita al server e era pronto a testare.ASP.NET non può eliminare "500- Errore interno server"

All'improvviso viene fuori una nuova modifica, e dopo aver cancellato i file nel server e ripubblicato il progetto (so che non è necessario, ma ancora ..) non sono più in grado di accedere al sito.

Tutto ciò che ottengo è 500- Errore interno server C'è un problema con la risorsa che si sta cercando e non può essere visualizzato.

ho cercato di accendere la funzione di debug con il debug = "True" in cima alla pagina, ho impostato

<customErrors mode="Off"/> 
<compilation debug="true" targetFramework="4.5"/> 

Nel file web.config, e ho anche provato ad aggiungere

<httpErrors errorMode="Detailed" /> 

ma nessuno di loro ha aiutato ad avere un messaggio di errore migliore.

mio file web.config è:

<?xml version="1.0"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=169433 
    --> 
<configuration> 
    <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> 
    </configSections> 
    <connectionStrings> 
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-ASP-20130619150943;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-ASP-20130619150943.mdf"/> 
    </connectionStrings> 
    <!-- 
    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367. 

    The following attributes can be set on the <httpRuntime> tag. 
     <system.Web> 
     <httpRuntime targetFramework="4.5" /> 
     </system.Web> 
    --> 
    <system.web> 
    <customErrors mode="Off"/> 
    <compilation debug="true" targetFramework="4.5"/> 
    <httpRuntime/> 
    <pages controlRenderingCompatibilityVersion="4.0"> 
     <namespaces> 
     <add namespace="System.Web.Optimization"/> 
     </namespaces> 
     <controls> 
     <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/> 
     </controls> 
    </pages> 
    <authentication mode="Forms"> 
     <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/"/> 
    </authentication> 
    <profile defaultProvider="DefaultProfileProvider"> 
     <providers> 
     <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
     </providers> 
    </profile> 
    <membership defaultProvider="DefaultMembershipProvider"> 
     <providers> 
     <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> 
     </providers> 
    </membership> 
    <roleManager defaultProvider="DefaultRoleProvider"> 
     <providers> 
     <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
     </providers> 
    </roleManager> 
    <!-- 
      If you are deploying to a cloud environment that has multiple web server instances, 
      you should change session state mode from "InProc" to "Custom". In addition, 
      change the connection string named "DefaultConnection" to connect to an instance 
      of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express. 
     --> 
    <sessionState mode="InProc" customProvider="DefaultSessionProvider"> 
     <providers> 
     <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/> 
     </providers> 
    </sessionState> 
    </system.web> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246"/> 
     <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246"/> 
     <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/> 
    </entityFramework> 

    <appSettings> 
    <add key="CRMUserName" value="xxxx" /> 
    <add key="CrmUserPassword" value="yyyy" /> 
    <add key="OrganizationUri" value="https://uuuuuu/XRMServices/2011/Organization.svc" /> 
    <add key="HomeRealmUri" value="" /> 
    </appSettings> 
</configuration> 

ricevo un messaggio di errore quando si esegue la pagina. Il messaggio di errore è:
Si è verificato un errore durante la verifica della sicurezza per il messaggio System.ServiceModel.FaultException: si è verificato un errore durante la verifica della sicurezza per il messaggio.

La sezione in cui i fuochi di errore è:

RetrieveAttributeRequest retrieveFreightTerm = new RetrieveAttributeRequest 
    { 
    EntityLogicalName = "account", 
    LogicalName = "address1_freighttermscode", 
    RetrieveAsIfPublished = true 
    }; 

Tutte le idee?

+0

1. Puoi screenshot e inviare la pagina di errore che si ottiene con le impostazioni di cui sopra? 2. Presumo che questo sia IIS7 o 7.5? – Kev

+1

Prova anche a impostare l'attributo 'existingResponse =" PassThrough "nell'elemento' httpErrors'. – Kev

+0

Puoi controllare il Visualizzatore eventi, ci saranno più dettagli registrati da IIS. –

risposta

6

ho aperto il sito web dal server che esegue IIS e ho potuto vedere una pagina di errore dettagliato, tutte le informazioni di cui avevo bisogno

+0

La migliore soluzione. Grazie –

4

Molte volte accade dopo aver modificato il file web.config, lasciamo alcuni tag non correttamente chiusi o per dire non ben formati. Ciò porta anche a 500 Errore interno del server.

Per assicurarsi che il tuo web.configpassi questo controllo, aprilo in Internet Explorer. Nel caso in cui qualche tag venga perso, l'IE mostrerà l'errore corrispondente.

+0

Questo è un ottimo consiglio. Stavo avendo un problema simile con il mio web config e IE lo ha trovato immediatamente. –

Problemi correlati