Visualizzazione dei risultati da 1 a 10 su 10
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2011
    Messaggi
    77

    Server Error in '/' Application.

    Ciao a tutti, ho un problema nel pubblicare un sito asp.net.
    Ho un sito asp.net fatto con visual web developer, con un database sql server. Sto provando a pubblicarlo su un sito di hosting gratuito che supporta asp.net con sql server (www.somee.com).
    Ho caricato la cartella contenente il sito e ho provato ad aprire il sito. La pagina di login si apre correttamente ma una volta fatto il login quando mi reinderizza alla pagina di default mi esce questo errore:

    Server Error in '/' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".



    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.



    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>

    Ho già cercato in altre discussioni ma non sono riuscito a trovare una soluzione, potete aiutarmi? Grazie!

  2. #2
    hai provato semplicemente a fare quello che ti dice la pagina di errore:

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    codice:
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

  3. #3
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    Semplicemente e come già detto, fai quello che la pagina ti suggerisce
    Dopo, dovresti vedere il vero messaggio di errore.

  4. #4
    Utente di HTML.it
    Registrato dal
    Oct 2011
    Messaggi
    77
    Grazie, mi da questo errore:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
    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: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Sapete dirmi di che cosa si tratta? Grazie!

  5. #5
    molto probabilmente hai la stringa di connessione errata per il database

  6. #6
    Utente di HTML.it
    Registrato dal
    Oct 2011
    Messaggi
    77
    Devo guardare nel web.config? E' normale che però la pagina di login si apre e funziona? Vi allego il web.config, sapete dirmi cosa sbaglio? Grazie infinite

    codice:
    <?xml version="1.0"?>
    <!--
      Per ulteriori informazioni su come configurare l'applicazione ASP.NET, visitare il sito Web all'indirizzo
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <connectionStrings>
           <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
          providerName="System.Data.SqlClient" />
        <add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True"
          providerName="System.Data.SqlClient" />
        <add name="ConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True"
          providerName="System.Data.SqlClient" />
        <add name="ConnectionString3" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True"
          providerName="System.Data.SqlClient" />
        <add name="ConnectionString4" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True"
          providerName="System.Data.SqlClient" />
      </connectionStrings>
      <system.web>
        <customErrors mode="Off"/>
        <authorization>
          <deny users="?" />
        </authorization>
        <compilation debug="true" targetFramework="4.0"/>
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
        </authentication>
        <membership>
          <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
          </providers>
        </membership>
        <profile>
          <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
          </providers>
        </profile>
        <roleManager enabled="false">
          <providers>
            <clear/>
            <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
            <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
          </providers>
        </roleManager>
      </system.web>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    </configuration>

  7. #7
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    Devi mettere la giusta stringa di connessione (una, preferibilmente) al Database, in questa sezione:

    codice:
      <connectionStrings>
           <add name="ConnString" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
          providerName="System.Data.SqlClient" />
      </connectionStrings>
    la pagina di Login funziona perchè ancora non è stato chiamato in causa il DB..

  8. #8
    Utente di HTML.it
    Registrato dal
    Oct 2011
    Messaggi
    77
    Ho un dubbio, io quando ho creato il sito ho creato una cartella chiamata app_data con dentro il database. Quando l'ho caricato sul sito, ho caricato anche questa cartella. Sul pannello di controllo c'è però una sezione chiamata database in cui si carica il database del sito. Devo cancellare l'app_data e caricare il database in quella sezione?
    Grazie!

  9. #9
    Moderatore di ASP.net L'avatar di djciko
    Registrato dal
    Nov 2002
    Messaggi
    6,887
    No probabilmente l'hosting ha quella cartella perche' non sa che linguaggio userai per il tuo sito.

    Se hai fatto le cose con tutti gli strumenti che ti mette a disposizione Microsoft si, di default (a meno che non personalizzi il tutto) devi usare il DB .mdf che ha le tabelle per gestire gli utenti, i ruoli etc. e deve stare nella cartella app_data (ed il framework deve essere attivo sul server).

    guarda qui (leggilo con un pizzico di pazienza):

    http://download.microsoft.com/downlo...2011-12-14-002

  10. #10
    dovresti contattare il supporto del tuo hoster e verificare l'accesso a SQL.
    ti diranno loro come e se puoi accedere a SQL.

    Hai comprato uno spazio free? difficile che ti lascino usare SQL Server.

    leggi qui
    http://somee.com/doka/DoHelpTopics.a...false&thnid=72

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.