系统找不到指定类的文件

时间:2017-06-27 20:18:48

标签: asp.net

我的网站正在离线工作,但是在线它给了我以下错误。我们已经解决了SQL,因为它可能是DB问题,有一个类的引用,这个类是要访问数据库。这是一个练习:https://code.msdn.microsoft.com/Getting-Started-with-221c01f5#content

系统找不到指定的文件 描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。 异常详细信息:System.ComponentModel.Win32Exception:系统找不到指定的文件 来源错误: 在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。 堆栈跟踪: [Win32Exception(0x80004005):系统找不到指定的文件] [SqlException(0x80131904):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供程序:SQL网络接口,错误:52 - 无法找到本地数据库运行时安装。验证是否已正确安装SQL Server Express并且已启用本地数据库运行时功能。)]    **

  

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity   identity,SqlConnectionString connectionOptions,SqlCredential   凭证,Object providerInfo,String newPassword,SecureString   newSecurePassword,Boolean redirectedUserInstance,SqlConnectionString   userConnectionOptions,SessionData reconnectSessionData,   DbConnectionPool池,String accessToken,Boolean   applyTransientFaultHandling)+821
  System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions   options,DbConnectionPoolKey poolKey,Object poolGroupProviderInfo,   DbConnectionPool池,DbConnection owningConnection,   DbConnectionOptions userOptions)+332
  System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(类DBConnectionPool   pool,DbConnection owningObject,DbConnectionOptions选项,   DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)+38
  System.Data.ProviderBase.DbConnectionPool.CreateObject(的DbConnection   owningObject,DbConnectionOptions userOptions,DbConnectionInternal   oldConnection)+699
  System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(的DbConnection   owningObject,DbConnectionOptions userOptions,DbConnectionInternal   oldConnection)+89
  System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection   owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean   allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions   userOptions,DbConnectionInternal&连接)+426
  System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection   owningObject,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource
1重试,DbConnectionOptions   userOptions,DbConnectionInternal oldConnection,DbConnectionInternal&   连接)+191
  System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(的DbConnection   outerConnection,DbConnectionFactory connectionFactory,   TaskCompletionSource 1 retry, DbConnectionOptions userOptions) +154
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1重试,DbConnectionOptions userOptions)+21
  System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) +90
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
1   重试)+217 System.Data.SqlClient.SqlConnection.Open()+96
  System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36(的DbConnection   t,DbConnectionInterceptionContext c)+10
  System.Data.Entity.Infrastructure.Interception.InternalDispatcher 1.Dispatch(TTarget target, Action 2操作,TInterceptionContext interceptionContext,   行动3 executing, Action 3已执行)+72
  System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(的DbConnection   connection,DbInterceptionContext interceptionContext)+360
  System.Data.Entity.SqlServer<> c__DisplayClass33.b__32()   +426 System.Data.Entity.SqlServer。<> c__DisplayClass1.b__0()+10
  System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func 1 operation) +189
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) +78
System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action
1 act)+177
  System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(的DbConnection   sqlConnection,Action 1 act) +556
System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable
1   commandTimeout,DbConnection sqlConnection,String   createDatabaseScript)+86
  System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(的DbConnection   connection,Nullable 1 commandTimeout, StoreItemCollection storeItemCollection) +164
System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable
1 commandTimeout,StoreItemCollection   storeItemCollection)+76
  System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()+134
  System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(的DbConnection   连接)+119
  System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(动作   mustSucceedToKeepDatabase)+142
  System.Data.Entity.Migrations.DbMigrator.Update(字符串   targetMigration)+78
  System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext   internalContext,Func 3 createMigrator, ObjectContext objectContext) +89 System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) +116
System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +218
System.Data.Entity.CreateDatabaseIfNotExists
1.InitializeDatabase(TContext   上下文)+151
  System.Data.Entity.Internal。&lt;&gt; c__DisplayClassf 1.<CreateInitializationAction>b__e() +76 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +357 System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7
System.Data.Entity.Internal.RetryAction
1.PerformAction(TInput input)   +110 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action 1 action) +198
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28
System.Data.Entity.Internal.Linq.InternalSet
1.Initialize()+53
  System.Data.Entity.Internal.Linq.InternalSet 1.GetEnumerator() +15
System.Data.Entity.Infrastructure.DbQuery
1.System.Collections.IEnumerable.GetEnumerator()   +52 System.Web.UI.WebControls.ListViewPagedDataSource.GetEnumerator()+291   System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource   dataSource,Boolean dataBinding,InsertItemPosition insertPosition,   ArrayList keyArray)+209
  System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable的   dataSource,Boolean dataBinding)+1032
  System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable的   数据)+35
  System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable的   数据)+128
  System.Web.UI.DataSourceView.Select(DataSourceSelectArguments   参数,DataSourceViewSelectCallback回调)+34
  System.Web.UI.WebControls.ModelDataSourceView.Select(DataSourceSelectArguments   参数,DataSourceViewSelectCallback回调)+80
  System.Web.UI.WebControls.DataBoundControl.PerformSelect()+ 143 3   System.Web.UI.WebControls.ListView.PerformSelect()+ 0102   System.Web.UI.WebControls.BaseDataBoundControl.DataBind()+74
  System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()+ 114   System.Web.UI.WebControls.ListView.CreateChildControls()+52
  System.Web.UI.Control.EnsureChildControls()+92
  System.Web.UI.Control.PreRenderRecursiveInternal()+42
  System.Web.UI.Control.PreRenderRecursiveInternal()+160
  System.Web.UI.Control.PreRenderRecursiveInternal()+160
  System.Web.UI.Control.PreRenderRecursiveInternal()+160
  System.Web.UI.Page.ProcessRequestMain(布尔   includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)   883

**

这是代码可能存在的问题,因为网站正在运行,没有此代码。

            <asp:ListView ID="categoryList"  
            ItemType="MyToysHome.Models.Category" 
            runat="server"
            SelectMethod="GetCategories" >
            <ItemTemplate>
                <b style="font-size: large; font-style: normal">

            <a href="~/ProductList.aspx?id=<%#: Item.CategoryID %>">
            <%#: Item.CategoryName %></a>
                </a>
                </b>
            </ItemTemplate>
            <ItemSeparatorTemplate>  |  </ItemSeparatorTemplate>
            </asp:ListView>

0 个答案:

没有答案
相关问题