?
Solved

Probelems Moving ASP.net application to SBS 2011

Posted on 2011-10-13
19
Medium Priority
?
710 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:piotrmikula108
  • 11
  • 5
16 Comments
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36966344
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?

0
 
LVL 15

Expert Comment

by:Eyal
ID: 36967364
what do you have in the event viewer?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 1

Author Comment

by:piotrmikula108
ID: 36970211
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
0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36970314
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

0
 
LVL 15

Expert Comment

by:Eyal
ID: 36975137
well

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

2) check the username and password used


0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36976375
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
0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36976382
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

0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36976415
do I need to worry about any ODBC issues?
0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36976433
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
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36977158
post the connection string you are using
0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 36977642
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

0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 37013094
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
0
 
LVL 15

Expert Comment

by:Eyal
ID: 37051917
try to change the data source to...

Public Shared DBConn As String = "data source=SQLEXPRESS\.;Initial Catalog=dbname;User ID=userid;Password=DBpass"
0
 
LVL 1

Accepted Solution

by:
piotrmikula108 earned 0 total points
ID: 37053531
We were forced to recompile the app in .Net 4

thanks all for assisting with this
0
 
LVL 1

Author Closing Comment

by:piotrmikula108
ID: 37277761
we were forced to recomplile the app in .net 4

thx all for your contribution
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question