Link to home
Start Free TrialLog in
Avatar of piotrmikula108
piotrmikula108Flag for United States of America

asked on

Probelems Moving ASP.net application to SBS 2011

I have a ASP.net application built about 3 years ago, it runs on SBS 2003 (SQL 2005 and ASP 1.1? that's what I found in IIS).

I moved the IIS root folder over, restored the DB in 2005 compatibility mode on SQL 2008 R2. Set the App Pool to run in 32 bit mode. Added host name to the website and DNS called say ActionItems, when I try to open the page the App Pool stops and the website gives

503. Service not available error.

I start it manually type ActionItem and the service stops

What do I need to do to fix it?
Avatar of piotrmikula108

ASKER

I appreciate the links

I followed closely the guide, I don't know if the application I have has any registry dependencies so I didn't migrate anything. I change the web app to run under the .Net 1.1 pool and the app pool stops and I get the 503 error again

Any ideas where else to look?

what do you have in the event viewer?
nothing really related to that application when it stops.

I'm trying to run the app on a W2k8 R2 Standard with SQL Express 2008 R2 and the default App Pool doens't crash but the page gives me a dot net error that it can't connect to the DB. I have restored the DB from the old server
here is the error

the current DB runs under SQL 2005 Workgroup edition, instance name MSSQLSERVER, the new SQL is Express 2008 R2 with instance name SQLEXPRESS
Server Error in '/' Application.
--------------------------------------------------------------------------------

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 
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: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849015
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4862333
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
   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
   spencer.global.IsAdmin(String User) in C:\Inetpub\wwwroot\spencer\global.vb:24
   spencer.mainNav.ShowSubMenu(Int16 curTab, Int16 curSubTab) in C:\Inetpub\wwwroot\spencer\controls\mainNav.ascx.vb:60
   spencer.login.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\spencer\login.aspx.vb:34
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Open in new window

well

1) check accessibility to the SQL server
ping SQLIP
telnet SQLIP 1433

2) check the username and password used


it's all on one box with FW disabled
I'm scratching my head, to remove any incompatibility issues with newer OS I tried to move the app to another SBS 2003 server and getting the same problem
here is the error

Server Error in '/' Application.
SQL Server does not exist or access denied.
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: SQL Server does not exist or access denied.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.CreateConnection() +402
   System.Data.SqlClient.ConnectionPool.UserCreateRequest() +151
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +464
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +384
   spencer.global.IsAdmin(String User) in C:\Inetpub\wwwroot\spencer\global.vb:24
   spencer.mainNav.ShowSubMenu(Int16 curTab, Int16 curSubTab) in C:\Inetpub\wwwroot\spencer\controls\mainNav.ascx.vb:60
   spencer.login.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\spencer\login.aspx.vb:34
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750


Version Information: Microsoft .NET Framework Version:1.1.4322.2443; ASP.NET Version:1.1.4322.2460

Open in new window

do I need to worry about any ODBC issues?
FYI - I created  a FILE DSN ODBC connection just to see what I get and connection Test completed OK with the user/pwd I used in the connection string
post the connection string you are using
hi

my web.config file has this

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>

but there is also a global.vb file that only exist in the original project but is not present in the wwwroot folder of the IIS website and it has this string which I would think is not used. I'm little bit confused here

    Public Shared DBConn As String = "data source=serrverbname;Initial Catalog=dbname;User ID=userid;Password=DBpass"

I have not built this app, but have access to hopefully final version of the Visual Studio project, and I'm looking into the code now to try to see if I can figure anything out

Login page that opens up first when it's launched on the old production server that I need move it from has this code below
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="login.aspx.vb" Inherits="spencer.login"%>
<%@ Register TagPrefix="uc1" TagName="mainNav" Src="controls/mainNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="header" Src="controls/header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="footer" Src="controls/footer.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>name</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie3-2nav3-0">
		<LINK href="MainStyle.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			<asp:Table id="tblMain" runat="server" Width="800px" HorizontalAlign="Center">
				<asp:TableRow VerticalAlign="Top" HorizontalAlign="Center">
					<asp:TableCell>
						<uc1:header runat="server" ID="Header1"></uc1:header>
					</asp:TableCell>
				</asp:TableRow>
				<asp:TableRow VerticalAlign="Top" HorizontalAlign="Center">
					<asp:TableCell>
						<uc1:mainNav runat="server" ID="MainNav1"></uc1:mainNav>
					</asp:TableCell>
				</asp:TableRow>
				<asp:TableRow VerticalAlign="Top" HorizontalAlign="Center">
					<asp:TableCell>
						<TABLE id="Table1" height="133" cellSpacing="1" cellPadding="1" width="350" align="center"
							border="0">
							<TR>
								<TD colSpan="2">
									<P align="center"><STRONG><FONT face="Arial">Please Log In<BR>
											</FONT></STRONG>
										<asp:Label runat="server" ID="lblMessage"></asp:Label>
									</P>
								</TD>
							</TR>
							<TR>
								<TD>
									<P align="right"><FONT face="Arial" size="2"><STRONG>User Name: </STRONG></FONT>
									</P>
								</TD>
								<TD>
									<P align="left">
										<asp:TextBox runat="server" ID="txtUserName"></asp:TextBox>
										<FONT face="Arial" size="2"><STRONG></STRONG></FONT>
									</P>
								</TD>
							</TR>
							<TR>
								<TD>
									<P align="right"><FONT face="Arial" size="2"><STRONG>Password:</STRONG></FONT>
									</P>
								</TD>
								<TD>
									<P>
										<asp:TextBox runat="server" TextMode="Password" ID="txtPassword"></asp:TextBox>
									</P>
								</TD>
							</TR>
							<TR>
								<TD colSpan="2">
									<P align="center">
										<asp:Button runat="server" ID="Button1" Text="Log In"></asp:Button>
									</P>
								</TD>
							</TR>
						</TABLE>
					</asp:TableCell>
				</asp:TableRow>
				<asp:TableRow VerticalAlign="Top" HorizontalAlign="Center">
					<asp:TableCell>
						<uc1:footer runat="server" ID="Footer1"></uc1:footer>
					</asp:TableCell>
				</asp:TableRow>
			</asp:Table>
		</form>
	</body>
</HTML>

Open in new window

we had to recompile to app to run under .Net 4.0, it works on W2k8 R2 but doens't on SBS 2011 fully patched. I called Microsoft Support and they are working on this as it appears to be a bug in their software
try to change the data source to...

Public Shared DBConn As String = "data source=SQLEXPRESS\.;Initial Catalog=dbname;User ID=userid;Password=DBpass"
ASKER CERTIFIED SOLUTION
Avatar of piotrmikula108
piotrmikula108
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
we were forced to recomplile the app in .net 4

thx all for your contribution