“/”应用程序中的服务器错误。
Directory lookup for the file "C:\IIS\Test\TestMvc\App_Data\aspnet-MvcApplication1-20140319094015.mdf" failed with the operating system error 2(系统找不到指定的文件。). CREATE DATABASE failed. Some file names listed could not be created. Check related errors. 说明:执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息:System.Data.SqlClient.SqlException: Directory lookup for the file "C:\IIS\Test\TestMvc\App_Data\aspnet-MvcApplication1-20140319094015.mdf" failed with the operating system error 2(系统找不到指定的文件。). CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[SqlException (0x80131904): Directory lookup for the file "C:\IIS\Test\TestMvc\App_Data\aspnet-MvcApplication1-20140319094015.mdf" failed with the operating system error 2(系统找不到指定的文件。). CREATE DATABASE failed. Some file names listed could not be created. Check related errors.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +392 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515 System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +1390 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +538 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +290 System.Data.SqlClient.<>c__DisplayClassa.b__7(SqlConnection conn) +164 System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) +146 System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +3778055 System.Data.SqlClient.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +297 System.Data.Objects.ObjectContext.CreateDatabase() +260 MvcApplication1.Filters.SimpleMembershipInitializer..ctor() in d:\项目文档\MvcApplication1\MvcApplication1\Filters\InitializeSimpleMembershipAttribute.cs:37 [InvalidOperationException: 无法初始化 ASP.NET Simple Membership 数据库。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=256588] MvcApplication1.Filters.SimpleMembershipInitializer..ctor() in d:\项目文档\MvcApplication1\MvcApplication1\Filters\InitializeSimpleMembershipAttribute.cs:45 [TargetInvocationException: 调用的目标发生了异常。]
这个数据文件在服务器上不存在的,在服务器配置的只有 bin Content Images Scripts Views Global.asax Web.Config 这些文件