Connect with Expertise | Find Experts, Get Answers, Share Insights

Porting a custom .net application to a new machine JIT errors

 
Join Date: Mar 2010
Posts: 3
#1: Mar 20 '10
Hello bytes community!

My friend is in a bit of a situation and i've been trying to help him for a while now. He runs a business to where someone coded a .NET 1.1 program that connects to a SQL server in order to saves all it database information. The issue is that I can't move that program over because I don't know what it requires in order to run on another computer. He bought the program long ago from a college grad and that student is no longer available for assistance.

He's not worried about the information getting moved over as long as we can get the program moved one his old Windows 2000 Desktop to a newer computer with Windows 7.

If i copy the program directly to a another computer and run it, I can have it run, however, it continuously get exceptions due to what I think is it trying to connect to a SQL server that isn't there. Unfortunately though, I'm not entirely sure that is the case... I was wondering if someone can help tell me find out how it needs the SQL server to run (or what database it calls for) so that I can get it running on a new computer as soon as possible. (I am also wiling to send copies of the program as necessary for any help on this would be greatly appreciated.)

The current error I receive when im running it on a new computer is the following:

"See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

Expand|Select|Wrap|Line Numbers
  1. ************** Exception Text **************
  2. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 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)
  3.    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
  4.    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
  5.    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
  6.    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
  7.    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
  8.    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
  9.    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
  10.    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
  11.    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
  12.    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
  13.    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
  14.    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
  15.    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
  16.    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
  17.    at System.Data.SqlClient.SqlConnection.Open()
  18.    --- End of inner exception stack trace ---
  19.    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  20.    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
  21.    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  22.    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  23.    at Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o, MethodBase method, ParameterInfo[] Parameters, Object[] args, Type objType, IReflect objIReflect)
  24.    at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
  25.    at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
  26.    at CustomLinenSolutions.claCustomLinenData.AddLoginInformation(Int64& lngUserLoginID, Int32 intAppType)
  27.    at CustomLinenSolutions.frmMain.frmMain_Load(Object sender, EventArgs e)
  28.    at System.Windows.Forms.Form.OnLoad(EventArgs e)
  29.    at System.Windows.Forms.Form.OnCreateControl()
  30.    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  31.    at System.Windows.Forms.Control.CreateControl()
  32.    at System.Windows.Forms.Control.WmShowWindow(Message& m)
  33.    at System.Windows.Forms.Control.WndProc(Message& m)
  34.    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  35.    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
  36.    at System.Windows.Forms.Form.WmShowWindow(Message& m)
  37.    at System.Windows.Forms.Form.WndProc(Message& m)
  38.    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  39.    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  40.    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  41.  
  42.  
  43. ************** Loaded Assemblies **************
  44. mscorlib
  45.     Assembly Version: 2.0.0.0
  46.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  47.     CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
  48. ----------------------------------------
  49. CustomLinenSolutions
  50.     Assembly Version: 4.7.2.0
  51.     Win32 Version: 4.7.2.0
  52.     CodeBase: file:///C:/Users/Sir%20Sicarius/Desktop/CLS%20Files/CustomLinenSolutions.exe
  53. ----------------------------------------
  54. System.Windows.Forms
  55.     Assembly Version: 2.0.0.0
  56.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  57.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
  58. ----------------------------------------
  59. System
  60.     Assembly Version: 2.0.0.0
  61.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  62.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
  63. ----------------------------------------
  64. System.Drawing
  65.     Assembly Version: 2.0.0.0
  66.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  67.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
  68. ----------------------------------------
  69. Microsoft.VisualBasic
  70.     Assembly Version: 8.0.0.0
  71.     Win32 Version: 8.0.50727.4927 (NetFXspW7.050727-4900)
  72.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
  73. ----------------------------------------
  74. System.Data
  75.     Assembly Version: 2.0.0.0
  76.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  77.     CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
  78. ----------------------------------------
  79. System.Configuration
  80.     Assembly Version: 2.0.0.0
  81.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  82.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
  83. ----------------------------------------
  84. System.Xml
  85.     Assembly Version: 2.0.0.0
  86.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  87.     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
  88. ----------------------------------------
  89. System.Transactions
  90.     Assembly Version: 2.0.0.0
  91.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  92.     CodeBase: file:///C:/Windows/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
  93. ----------------------------------------
  94. System.EnterpriseServices
  95.     Assembly Version: 2.0.0.0
  96.     Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
  97.     CodeBase: file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
  98. ----------------------------------------
  99.  
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box."
best answer - posted by regalis
Hmmm...
I think you should look if there is a configurationfile where the databasename, tables, user, password and IP stands in there.
If no config is available maybe check the Databases the App is working with and try to rebuild them on the new Computer.(But i don't know if that is a good(working) solution, because i'm no Database expert :D)

greetz regalis

 
Join Date: Mar 2010
Location: Germany
Posts: 9
#2: Mar 20 '10

re: Porting a custom .net application to a new machine JIT errors


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)
The SQLServer is not accessible....
No network connection to Server?
No access rights on the Server?

Do you have the source code of the program or just the executable?
 
Join Date: Mar 2010
Posts: 3
#3: Mar 20 '10

re: Porting a custom .net application to a new machine JIT errors


I have just the executable, i do not have the source. I am willing to do what I can to help but I have no idea where to start..

I put the program on a new computer, and installed MS SQL server express 2005 to see if it would work, but again i'm not entirely sure where to begin. Let me know if there is anything else I can include...

Thank you for you reply though..
 
Join Date: Mar 2010
Location: Germany
Posts: 9
#4: Mar 21 '10

re: Porting a custom .net application to a new machine JIT errors


Hmmm...
I think you should look if there is a configurationfile where the databasename, tables, user, password and IP stands in there.
If no config is available maybe check the Databases the App is working with and try to rebuild them on the new Computer.(But i don't know if that is a good(working) solution, because i'm no Database expert :D)

greetz regalis
jkmyoung's Avatar
E
M
C
 
Join Date: Mar 2006
Posts: 1,938
#5: Mar 22 '10

re: Porting a custom .net application to a new machine JIT errors


Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
Was this program running on a single computer before, or was it connecting to another database server on the network?
Have you setup the SQL server to allow remote connections?
 
Join Date: Mar 2010
Posts: 3
#6: Mar 22 '10

re: Porting a custom .net application to a new machine JIT errors


Guys, thank you all for the help. I recently got with a programmer to help him rewrite the code and found out it was due to the SQL using named pipes. It was only running on a single computer, so right now, im making an image of it using VMware and loading it onto another computer temporarily until i have this programmer rewrite it.

Thanks again for all of the replies and assistance everyone!!!!

You guys are awesome.
Reply

Tags
sql .net