Fragensteller
ASP.NET Website mit Mitgliedschaft funktioniert nicht

Allgemeine Diskussion
-
Hallo,
ich habe mit Microsoft Visual Studio 2013 Web Prewiew eine ASP.NET Homepage mit einfacher Benutzeranmeldung ( in der web.config) erstellt. Offline hat das auch funktioniert. Die Website wollte ich anschließend hochladen, und zwar gehostet bei 1&1. Dort erscheint aber folgender Fehler:
---------------------------------------------------------
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error
details below and modify your configuration file appropriately.Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.Source Error:
Line 6: <compilation debug="true" />
Line 7: <customErrors mode="Off"/>
Line 8: <authentication mode="Forms">
Line 9: <forms name="MyAppCookie" loginUrl="~/Login.aspx" protection="All" timeout="30" path="/"/>
Line 10: </authentication>
Source File: ... Line: 8
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044
---------------------------------------------------------Zeile 8 war rot markiert.
Hat irgendjemand eine Ahnung, was ich tun könnte? Vielen Dank!!
- Bearbeitet einhertz Samstag, 26. Oktober 2013 12:53
- Typ geändert Ciprian Bogdan Dienstag, 11. März 2014 19:44
Alle Antworten
-
Vielen Dank, das war es.
Wenn ich mich aber anmelden möchte kommt folgende Fehlermeldung:
------------------------------------------------------------
Server Error in '/' Application.
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.
Stack Trace:
[SqlException (0x80131904): 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)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5296071 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +558 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +5308555 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +145 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +920 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +307 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +434 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +5311099 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +37 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +558 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +67 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1052 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +167 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +143 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +83 System.Data.SqlClient.SqlConnection.Open() +96 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +88 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +239 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +821 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +88 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106 System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +59 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +113 System.Web.UI.WebControls.Login.AttemptLogin() +119 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +75 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +159 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044
------------------------------------------------------------
Was soll ich nur tun :(
-
Hi,
die Fehlerausschrift sagt aus, dass der MembershipProvider nicht auf die Datenbank zugreifen kann. Generell gilt:1. der Servername im ConnectionString muss richtig sein
2. der Instanzname im ConnectionString muss richtig sein
3. Die serverseitige firewall (z.B. im Router) muss Zugriff über TCP-Port
1433 und UDP-Port 1434 zulassen, um »von Außen« den SQL Server erreichen zu können, bzw. den TCP-Port 445 für die Datei- und Druckerfreigabe, um über Named Pipes auf SQL-Server zugreifen zu können:
4. der Server muss Remote-Verbindungen zulassen
5. der Server muss TCP/IP zulassen
6. bei Windows-Authentifizierung muss der Client in der Domäne bekannt sein
7. bei SQL-Server-Authentifizierung müssen im SQL Server die Berechtigungen zum angegebenen Nutzernamen und Kennwort bekannt sein.
8. In der Datenbank müssen Berechtigungen gesetzt sein.
--
Peter
-
Hi,
welcher der Schritte bei der Einrichtung des MembershipProviders sind unklar: -
Hier ist mein Membership-Provider (aus der web.config):
<authentication mode="Forms"> <forms name="MyAppCookie" loginUrl="~/Login.aspx" protection="All" timeout="30" path="/"/> </authentication> <membership defaultProvider = "MyMembershipProvider"> <providers> <clear/> <add name = "MyMembershipProvider" type = "System.Web.Security.SqlMembershipProvider" connectionStringName = "LocalSqlServer" requiresQuestionAndAnswer = "false" requiresUniqueEmail ="false" minRequiredPasswordLength = "1" passwordFormat ="Clear" minRequiredNonalphanumericCharacters = "0" enablePasswordRetrieval = "true"/> </providers> </membership>
Sind da Fehler drin? -
Ich habe jetzt einiges ausprobiert, doch ohne Erfolg!! Was ich sagen kann:
- Die Website funktioniert offline mit dieser web.config.
- Online erscheint die bereits beschriebene Fehlermeldung.
Was genau ist der "connectionstring" eigentlich? Wie konfiguriere ich ihn ? Brauche ich spezielle Informationen von meinem Hoster?
Vielen Dank!!!!
-
*****************************************************************************************************
Dieser Thread wurde mangels weiterer Beteiligung ohne bestätigte Lösung abgeschlossen.
Neue Rückfragen oder Ergänzungen zu diesem Thread bleiben weiterhin möglich.
*****************************************************************************************************Ciprian Bogdan, MICROSOFT
Bitte haben Sie Verständnis dafür, dass im Rahmen dieses Forums, welches auf dem Community-Prinzip„Entwickler helfen Entwickler“ beruht, kein technischer Support geleistet werden kann oder sonst welche garantierten Maßnahmen seitens Microsoft zugesichert werden können.