MVC网站使用.net身份在IIS中托管

时间:2017-04-01 19:33:04

标签: asp.net-mvc asp.net-identity

我已经将一个.net mvc网站上传到了生产服务器,但每当我现在尝试登录时,我就得到...

"无效的登录尝试"

这在dev环境中完美运行,db已按原样上传。我想知道.net身份是否有些不对,但我的所有设置都与开发中的相同。

任何想法?

更新

实际上认为我的登录机制隐藏了真正的问题,我使用的是ef,每当网站尝试连接到我得到的数据库时......

DataException-> EntityException-> SQLEXCEPTION: 无法附加文件“{0}'作为数据库' {1}'

完全错误

[SqlException (0x80131904): Cannot attach the file 'D:\Websites\CMT\App_Data\Default.mdf' as database 'Default'.]
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +356
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +117
   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +267
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +318
   System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +132
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +246
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +104
   System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext) +509
   System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +15
   System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +238
   System.Data.Entity.Core.EntityClient.EntityConnection.Open() +319

0 个答案:

没有答案