От: | AndrewVK | http://blogs.rsdn.org/avk | |
Дата: | 12.12.11 13:43 | ||
Оценка: |
Исключение | |
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.dll!System.Data.SqlClient.SqlInternalConnection.OnError(System.Data.SqlClient.SqlException exception, bool breakConnection) + 0x150 bytes System.Data.dll!System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() + 0x19c bytes System.Data.dll!System.Data.SqlClient.TdsParser.Connect(System.Data.SqlClient.ServerInfo serverInfo, System.Data.SqlClient.SqlInternalConnectionTds connHandler, bool ignoreSniOpenTimeout, long timerExpire, bool encrypt, bool trustServerCert, bool integratedSecurity) + 0x4bb bytes System.Data.dll!System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(System.Data.SqlClient.ServerInfo serverInfo, string newPassword, bool ignoreSniOpenTimeout, System.Data.ProviderBase.TimeoutTimer timeout, System.Data.SqlClient.SqlConnection owningObject) + 0xb4 bytes System.Data.dll!System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(System.Data.SqlClient.ServerInfo serverInfo, string newPassword, bool redirectedUserInstance, System.Data.SqlClient.SqlConnection owningObject, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Data.ProviderBase.TimeoutTimer timeout) + 0x16c bytes System.Data.dll!System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(System.Data.SqlClient.SqlConnection owningObject, System.Data.ProviderBase.TimeoutTimer timeout, System.Data.SqlClient.SqlConnectionString connectionOptions, string newPassword, bool redirectedUserInstance) + 0xee bytes System.Data.dll!System.Data.SqlClient.SqlInternalConnectionTds.SqlInternalConnectionTds(System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, object providerInfo, string newPassword, System.Data.SqlClient.SqlConnection owningObject, bool redirectedUserInstance) + 0x160 bytes System.Data.dll!System.Data.SqlClient.SqlConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions options, object poolGroupProviderInfo, System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningConnection) + 0x1fa bytes System.Data.dll!System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(System.Data.Common.DbConnection owningConnection, System.Data.ProviderBase.DbConnectionPoolGroup poolGroup) + 0x2b bytes System.Data.dll!System.Data.ProviderBase.DbConnectionFactory.GetConnection(System.Data.Common.DbConnection owningConnection) + 0xaf bytes System.Data.dll!System.Data.ProviderBase.DbConnectionClosed.OpenConnection(System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory) + 0x86 bytes System.Data.dll!System.Data.SqlClient.SqlConnection.Open() + 0x12c bytes System.Web.dll!System.Web.Management.SqlServices.GetSqlConnection(string server, string user, string password, bool trusted, string connectionString) + 0xb3 bytes System.Web.dll!System.Web.Management.SqlServices.SetupApplicationServices(string server, string user, string password, bool trusted, string connectionString, string database, string dbFileName, System.Web.Management.SqlFeatures features, bool install) + 0xa7 bytes System.Web.dll!System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(string fullFileName, string dataDir, string connectionString) + 0x3d3 bytes System.Web.dll!System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(string connectionString) + 0x485 bytes System.Web.dll!System.Web.DataAccess.SqlConnectionHelper.GetConnection(string connectionString, bool revertImpersonation) + 0x7d bytes System.Web.dll!System.Web.Security.SqlRoleProvider.GetRolesForUser(string username) + 0xa2 bytes WebMatrix.WebData.dll!WebMatrix.WebData.SimpleRoleProvider.GetRolesForUser(string username) + 0x4b bytes System.Web.dll!System.Web.Security.RolePrincipal.IsInRole(string role) + 0x107 bytes System.Web.dll!System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(System.Collections.Specialized.StringCollection roles, System.Security.Principal.IPrincipal principal) + 0xf2 bytes System.Web.dll!System.Web.Configuration.AuthorizationRule.IsUserAllowed(System.Security.Principal.IPrincipal user, string verb) + 0x194 bytes System.Web.dll!System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(System.Security.Principal.IPrincipal user, string verb) + 0xf1 bytes System.Web.dll!System.Web.Security.UrlAuthorizationModule.OnEnter(object source, System.EventArgs eventArgs) + 0x135 bytes System.Web.dll!System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x50 bytes System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step, ref bool completedSynchronously) + 0x10e bytes System.Web.dll!System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception error) + 0x6f5 bytes System.Web.dll!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb) + 0x85 bytes System.Web.dll!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context) + 0x2b6 bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x3bf bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x22 bytes [Native to Managed Transition] [Managed to Native Transition] System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x4f4 bytes System.Web.dll!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr managedHttpContext, System.IntPtr nativeRequestContext, System.IntPtr moduleData, int flags) + 0x22 bytes [Appdomain Transition] | |
<html>
Здесь custom error страничка с описанным исключением
</html>
<html>
Здесь вполне нормальный контент целевой страницы
</html>
От: | AndrewVK | http://blogs.rsdn.org/avk | |
Дата: | 12.12.11 14:04 | ||
Оценка: |
<configuration>
<system.web>
<authorization>
<allow roles="user" />
<deny users="*"/>
</authorization>
</system.web>
</configuration>
<system.web>
...
<anonymousIdentification enabled="true" cookieTimeout="43200" />
<authentication mode="Forms">
<forms name=".AUTH" loginUrl="~/Users/Login.aspx" timeout="43200" />
</authentication>
<authorization>
<allow users="*"/>
</authorization>
...
От: | Doc | http://andrey.moveax.ru | |
Дата: | 12.12.11 18:10 | ||
Оценка: |
От: | AndrewVK | http://blogs.rsdn.org/avk | |
Дата: | 12.12.11 18:28 | ||
Оценка: |
От: | AndrewVK | http://blogs.rsdn.org/avk | |
Дата: | 12.12.11 18:30 | ||
Оценка: |
От: | Alexey Axyonov | ||
Дата: | 13.12.11 15:57 | ||
Оценка: | 116 (5) |
When you upgrade an ASP.NET MVC 2 project to ASP.NET MVC 3, make sure to add the following to the appSettings section of the Web.config file:
<appSettings>
<add key="enableSimpleMembership" value="false" />
</appSettings>
[assembly: PreApplicationStartMethod(typeof (PreApplicationStartCode), "Start")]
internal static void PreAppStartInit()
{
if (!ConfigUtil.SimpleMembershipEnabled)
return;
MembershipProvider currentDefault1 = Membership.Providers["AspNetSqlMembershipProvider"];
if (currentDefault1 != null)
{
SimpleMembershipProvider membershipProvider = WebSecurity.CreateDefaultSimpleMembershipProvider("AspNetSqlMembershipProvider", currentDefault1);
Membership.Providers.Remove("AspNetSqlMembershipProvider");
Membership.Providers.Add((ProviderBase) membershipProvider);
}
Roles.Enabled = true;
RoleProvider currentDefault2 = Roles.Providers["AspNetSqlRoleProvider"];
if (currentDefault2 == null)
return;
SimpleRoleProvider simpleRoleProvider = WebSecurity.CreateDefaultSimpleRoleProvider("AspNetSqlRoleProvider", currentDefault2);
Roles.Providers.Remove("AspNetSqlRoleProvider");
Roles.Providers.Add((ProviderBase) simpleRoleProvider);
}
От: | AndrewVK | http://blogs.rsdn.org/avk | |
Дата: | 13.12.11 21:36 | ||
Оценка: |