Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 996
  • Last Modified:

ASPNETDB.MDF from Host Server --- Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

I ran into a problem transfering the website from the developer box to the host box.   I developed in 2008 VDE and 2008 SQL Express.  From the error I am guessing there is a problem with the website connecting to the database.

So I used asp.net Frameworks Reg SQL on the Host Box Located:
("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe")

Then I changed the Machine.Config File on the Host box also Located
("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config")
I modified the connection string to this -

  <connectionStrings>
    <add name="LocalSqlServer" connectionString="data source=AMCAP000;Integrated Security=SSPI;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>


Any suggestions on how to make this work?

Server Error in '/ACF' Application.
--------------------------------------------------------------------------------
 
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
 
Source Error: 
 
 
Line 19:     public virtual string MyTheme {
Line 20:         get {
Line 21:             return ((string)(this.GetPropertyValue("MyTheme")));
Line 22:         }
Line 23:         set {
 
 
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\acf\233ceae2\35975430\App_Code.qtodrcie.0.cs    Line: 21 
 
Stack Trace: 
 
 
[SqlException (0x80131904): Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
   System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +772
   System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +433
   System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258
   System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132
   System.Configuration.SettingsBase.get_Item(String propertyName) +102
   System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
   System.Web.Profile.ProfileBase.get_Item(String propertyName) +68
   System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) +7
   ProfileCommon.get_MyTheme() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\acf\233ceae2\35975430\App_Code.qtodrcie.0.cs:21
   _Default.Page_PagePrePreInit(Object sender, EventArgs e) in G:\WEBSITE\ACF\Default.aspx.vb:5
   System.Web.UI.Page.OnPreInit(EventArgs e) +8694814
   System.Web.UI.Page.PerformPreInit() +31
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282
 
 
 
 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Open in new window

0
HarleySkater
Asked:
HarleySkater
  • 2
1 Solution
 
HarleySkaterAuthor Commented:
I commented out all the theme refrences in my aspx.vb pages behind code and the website it up, but of course without Profiling :*(  I am back on my developer box tryinig to configure the website to remotely connect to the aspnetdb I have on the Host Box :)

Provider Management  
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.  

Provider Management  
Could not establish a connection to the database. 
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.  

Open in new window

0
 
HarleySkaterAuthor Commented:
The following message may help in diagnosing the problem: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 141)

so I am going to try to go to my machine.config file first... well actually I am just going to delete it and then reinstall asp.net 3.5
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now