I have developed a site on my Win 7 (home PC) a I have published it on Win Server 2008 in other network (company PC). Everything works fine, however application doesn´t connect a sql database. I have tried deploy site on my Win 7 a it works. I am using File
system deploying method (building deployment package) and I just copy/transfer .zip file betwen PC´s. I don´t know what I´m doing wrong...
Any idea how to solve it ?? I can provide other informations about this problem if it will be necessary.
Oukey, so how to target the right database in production enviroment ??
I think that you are right - connection string is a problem because I except this exception when I test page in production enviroment:
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: 26 - Error Locating Server/Instance Specified) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection
owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean
redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open() at SQL_ConnString_Test.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\(My,User name)\Documents\Visual Studio 2010\Projects\SQL ConnString Test\SQL ConnString Test\WebForm1.aspx.cs:line 28
I have .zip file located on the desktop I physical path of his instalation is in C:\inetpub\wwwroot...
Build Deployment Package is not the same as file system deployment. The deployment package is a .zip file used by WebDeploy for deploying your site (potentially including files, IIS settings, databases, and more). If you're not familiar with WebDeploy,
you can learn more at http://www.iis.net/download/WebDeploy.
If you do just want to copy the files, you can create a new publish profile and use File System as the publish method. That will just create a folder with the contents of your side. You can copy that folder to your server and it should run (note: you may
need to take additional steps, such as creating/initializing your database, separately).
If this post has solved your problem, please select 'Mark as answer'
- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team
Marked as answer by Marchellito69 on Jul 07, 2012 05:58 AM
Hi, the problem was in Application Pools. In IIS Aplication Pools -> right mouse on AppPool for your site -> Advanced Settings -> in Process Model node is child Identity -> Change it from ApplicationPoolIdentity to Network service. This has solved my problem.
I have found it on some site of technical support of MS...
Marchellito6...
Member
60 Points
44 Posts
Deploying to Win Server 2008
Jul 04, 2012 09:36 AM|LINK
Hi,
I have developed a site on my Win 7 (home PC) a I have published it on Win Server 2008 in other network (company PC). Everything works fine, however application doesn´t connect a sql database. I have tried deploy site on my Win 7 a it works. I am using File system deploying method (building deployment package) and I just copy/transfer .zip file betwen PC´s. I don´t know what I´m doing wrong...
Any idea how to solve it ?? I can provide other informations about this problem if it will be necessary.
Horizon_Net
Star
8277 Points
1435 Posts
Re: Deploying to Win Server 2008
Jul 04, 2012 10:09 AM|LINK
Hi,
I would suggest that you first check your connection string for the database. Maybe it is not pointing to the right database.
If my post solves your problem, please mark as answer.
Marchellito6...
Member
60 Points
44 Posts
Re: Deploying to Win Server 2008
Jul 04, 2012 12:54 PM|LINK
Oukey, so how to target the right database in production enviroment ??
I think that you are right - connection string is a problem because I except this exception when I test page in production enviroment:
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: 26 - Error Locating Server/Instance Specified) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at SQL_ConnString_Test.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\(My,User name)\Documents\Visual Studio 2010\Projects\SQL ConnString Test\SQL ConnString Test\WebForm1.aspx.cs:line 28
I have .zip file located on the desktop I physical path of his instalation is in C:\inetpub\wwwroot...
jamlew
Participant
1977 Points
256 Posts
Microsoft
Re: Deploying to Win Server 2008
Jul 06, 2012 06:20 PM|LINK
Build Deployment Package is not the same as file system deployment. The deployment package is a .zip file used by WebDeploy for deploying your site (potentially including files, IIS settings, databases, and more). If you're not familiar with WebDeploy, you can learn more at http://www.iis.net/download/WebDeploy.
If you do just want to copy the files, you can create a new publish profile and use File System as the publish method. That will just create a folder with the contents of your side. You can copy that folder to your server and it should run (note: you may need to take additional steps, such as creating/initializing your database, separately).
- Jimmy Lewis
Microsoft SDET
Visual Web Developer Team
Marchellito6...
Member
60 Points
44 Posts
Re: Deploying to Win Server 2008
Jul 07, 2012 05:57 AM|LINK
Hi, the problem was in Application Pools. In IIS Aplication Pools -> right mouse on AppPool for your site -> Advanced Settings -> in Process Model node is child Identity -> Change it from ApplicationPoolIdentity to Network service. This has solved my problem. I have found it on some site of technical support of MS...