2016-10-24 25 views
0

私はVS 2013 - Webformsを使用して簡単なWebサイトを作成しています。私はasp.net webformsのinbuiltログインメカニズムを使用しています。私は私のマシン上でそれを実行するとすべて正常に動作しています。しかし、私はウェブサイトを公開するとき、それはデータベースが見つかりませんと言います。 私の接続文字列はLocalDbは、製品の目的のために意図されていないのでパブリッシュIISで動作しない場合がありVisual Studio-Asp.netログインウェブサイトの公開後にデータベースが動作しない

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-mywebsite-98edcb77-c971-4183-8070-4a6632b18ace;AttachDbFilename=|DataDirectory|\aspnet-mywebsite-98edcb77-c971-4183-8070-4a6632b18ace.mdf;Integrated Security=SSPI" providerName="System.Data.SqlClient" /> 

[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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. )]System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) +6568734 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +717
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6595176
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6597526
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6598067
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +942
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1162
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +72
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +6601321
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2102
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions) +6605815 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry) +233
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
1 retry) +278 System.Data.SqlClient.SqlConnection.Open() +239
System.Data.Entity.SqlServer.<>c__DisplayClass1.b__0() +15
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func 1 operation) +263
System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action
1 act) +325
System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) +575
System.Data.Entity.SqlServer.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +372
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +118

[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +459
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +48

[ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.]
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +238
System.Collections.Concurrent.ConcurrentDictionary 2.GetOrAdd(TKey key, Func 2 valueFactory) +83
System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection) +223
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +118
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +94
System.Data.Entity.Internal.RetryLazy 2.GetValue(TInput input) +248
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +618 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
System.Data.Entity.Internal.Linq.InternalSet
1.Initialize() +72
System.Data.Entity.Internal.Linq.InternalSet 1.get_InternalContext() +21 System.Data.Entity.Infrastructure.DbQuery 1.System.Linq.IQueryable.get_Provider() +68 System.Linq.Queryable.Where(IQueryable 1 source, Expression 1 predicate) +85
Microsoft.AspNet.Identity.EntityFramework.UserStore 1.FindByNameAsync(String userName) +696
Microsoft.AspNet.Identity.<FindByNameAsync>d__d.MoveNext() +214
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() +49 Microsoft.AspNet.Identity.d__0.MoveNext() +755 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 Microsoft.AspNet.Identity.d__4.MoveNext() +447 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 System.Runtime.CompilerServices.TaskAwaiter 1.GetResult() +49 Microsoft.AspNet.Identity.<CreateAsync>d__0.MoveNext() +752 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 Microsoft.AspNet.Identity.<CreateAsync>d__10.MoveNext() +859 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84 System.Runtime.CompilerServices.TaskAwaiter
1.GetResult() +49 Microsoft.AspNet.Identity.AsyncHelper.RunSync(Func`1 func) +239 Account_Register.CreateUser_Click(Object sender, EventArgs e) +134
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804

+0

変更?? – user2095748

+0

最初に:*ウェブサイトを公開した後には動作しません。 –

+0

インターネットインフォメーションサービス – user2095748

答えて

0

です。

このため、SQL ServerExpressを製品の目的に使用することをお勧めします。

SQL Server Compactにも同じ問題があります.Sql Server Expressに移行すると問題が解決します。

あなたは自制

1.Viewsについてlimitation

+0

それではどのようにビルドログインデータベースを使用できますか? – user2095748

+0

プロダクション環境でログインやその他の作業にSql Express Editionを使用する...不明な理由で私も同じことに直面し、あなたの前で私が説明していることを見つけた –

+0

現在のlocalDBをSql Expressに移行する方法と、文字列 – user2095748

0

を見ることができます - Windows認証

3.Rightしてデータベースに> SQL Serverのオブジェクトエクスプローラ

2.Loginを+余分なデータ層をクリックしてください

4. yourNameのデータベースを持つスキーマまたはデータを選択してください

5.選択したyourNameファイル(バックアップファイルとして機能します)を使用してデータを公開し、ターゲットデータベースをプロダクションにします。

次に、動作確認...

関連する問題