473,569 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Running C# (.NET Framework 2.0) Application from long path (>127)crashes!

Hello.

I have a very strange problem on my system with running C#
applications from a longer than usual (>127 chars) path. I was able to
reproduce the following 2 cases:
1. Socket s = new Socket(AddressF amily.InterNetw ork,
SocketType.Stre am, ProtocolType.Tc p); // <-- crashes here #1

2. SqlConnection con = new SqlConnection(" Persist Security
Info=False;serv er=MyServer\\My Instance;databa se=MyDataBase;C onnect
Timeout=30;Trus ted_Connection= True;");
con.Open(); // <-- crashes here #2

#1 crash shows the message: "WSAStartup cannot function at this time
because the underlying system it uses to provide network services is
currently unavailable."
#2 crash shows the message: "An error has occurred while establishing
a connection to the server. When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections. (provider: SQL Network
Interfaces, error: 26 - Error Locating Server/Instance Specified)"

My workstation settings:
Operating System: Windows XP SP2
Programming Environment: Microsoft Visual Studio 2005 Team Edition for
Software Developers (8.0.50727.42 RTM.050727-4200)
..NET Framework: .NET Framework 1.1, .NET Framework 2.0 Service Pack 1

If i run *any C# application* from a path that exeeds 127 characters
(including the file name) - it crashes. For example: C:\Documents and
Settings\user12 3.xCOMPANY\Loca l Settings\Apps\2 .0\HMTCX95T.RXV
\9CKLQ85R.AXB
\appl..tion_6e9 8555c88572fe0_0 001.0002_47eaa2 5a8a47e226\Test SPExecTestSPExe cTestSPExecTest SPExec.exe
If i change the file name and/or the path to make it less or equal to
127 characters, everything works fine! For example: C:\Documents and
Settings\user12 3.xCOMPANY\Loca l Settings\Apps\2 .0\HMTCX95T.RXV
\9CKLQ85R.AXB\T estSPExecTestSP ExecTestSPExec. exe

Does anyone have any clue about what the problem might be? I wouldn't
like to reinstall my workstation since i have a lot of SDKs installed
and configured, and it would take a lot of time to reconfigure
everything from scratch.

Thank you!
Jun 27 '08 #1
1 1696
On Jun 5, 5:31*pm, Stefan Pascal <stefan.pas...@ gmail.comwrote:
Hello.

I have a very strange problem on my system with running C#
applications from a longer than usual (>127 chars) path. I was able to
reproduce the following 2 cases:
1. Socket s = new Socket(AddressF amily.InterNetw ork,
SocketType.Stre am, ProtocolType.Tc p); // <-- crashes here #1

2. SqlConnection con = new SqlConnection(" Persist Security
Info=False;serv er=MyServer\\My Instance;databa se=MyDataBase;C onnect
Timeout=30;Trus ted_Connection= True;");
con.Open(); // <-- crashes here #2

#1 crash shows the message: "WSAStartup cannot function at this time
because the underlying system it uses to provide network services is
currently unavailable."
#2 crash shows the message: "An error has occurred while establishing
a connection to the server. *When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections. (provider: SQL Network
Interfaces, error: 26 - Error Locating Server/Instance Specified)"

My workstation settings:
Operating System: Windows XP SP2
Programming Environment: Microsoft Visual Studio 2005 Team Edition for
Software Developers (8.0.50727.42 RTM.050727-4200)
.NET Framework: .NET Framework 1.1, .NET Framework 2.0 Service Pack 1

If i run *any C# application* from a path that exeeds 127 characters
(including the file name) - it crashes. For example: C:\Documents and
Settings\user12 3.xCOMPANY\Loca l Settings\Apps\2 .0\HMTCX95T.RXV
\9CKLQ85R.AXB
\appl..tion_6e9 8555c88572fe0_0 001.0002_47eaa2 5a8a47e226\Test SPExecTestSPExe *cTestSPExecTes tSPExec.exe
If i change the file name and/or the path to make it less or equal to
127 characters, everything works fine! For example: C:\Documents and
Settings\user12 3.xCOMPANY\Loca l Settings\Apps\2 .0\HMTCX95T.RXV
\9CKLQ85R.AXB\T estSPExecTestSP ExecTestSPExec. exe

Does anyone have any clue about what the problem might be? I wouldn't
like to reinstall my workstation since i have a lot of SDKs installed
and configured, and it would take a lot of time to reconfigure
everything from scratch.

Thank you!
I forgot to mention that for the second case (SQLConnection exception)
the connection string is perfectly ok. As i said, the same EXE moved
(copied) to another (shorter) directory (path) or renamed in the same
directory runs without any problem! So it is a problem related to the
executable full path lenght.

Any ideas? Thank you.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1519
by: Brian Lesker | Impulse Info Systems | last post by:
Keywords: Oracle 6i Citrix ORA-06508 Crash Problem descryption: Oracle (6i) application crashes in Citrix farm with error ORA-06508. HOWTO resolve:
2
2135
by: Alexey Kouzmitch | last post by:
Hi, I wrote a console application which is called from a SQL Server job. The application utilizes a COM object, to pump data from a legacy (not very old however) application to SQL server. The application works fine, but once in a while it fails with the following message written to the event log: ...
5
1580
by: Ankit | last post by:
Hi, I have a VC++ application which uses a MS Access DB. I use DAO classes to carry out operations on the database. Off-late I have been experiencing a crash (of the application) after trying to execute a delete query. This happens only when the size of the DB reaches around 80MB to 1GB. Any idea as to why this could happen? I have...
2
1699
by: Ankit | last post by:
Hi, I have a VC++ DLL, which is inturn being used by a VB app. This VC++ DLL uses DAO to connect to a DB, which is an MS Access 97 DB. Now, at times (usually when the size of the Access DB crosses 70MB), when I fire a DELETE query on the DB (using DAO->Execute), the application crashes. I use BeginTrans and CommitTrans on the DB in order to...
2
2131
by: Christian Kreimer | last post by:
Hi I created an C# windows forms application that holds a user control. The user control itself is an editor for geographical information systems and is based on an ActiveX Library for providing basic geografic operations. It works fine most of the time, but sometimes it crashes with weird messages and i'm not able to track the error down -...
6
1418
by: jer84 | last post by:
Hi. This is my first app in vb.net. I've learned everything so far by reading through other posts, but I can't figure this one out and I need specific help. I'm using vb 2005 and I'm using mschrt20.ocx from vb6 within the project. I'm also exporting to Excel and have the references added to do that. I've created a setup project within my...
1
2245
by: teju | last post by:
I am using the OTL library for database interaction(otl.sourceforge.net) This is the sample code from my application: strm_ << parm.corp_id(); strm_ << parm.prod_id(); write_to_log(("Before parm.eff_ts()"<<parm.eff_ts()) strm_ << parm.eff_ts(); /** Application crashes here **/ write_to_log(("After parm.eff_ts()"<<parm.eff_ts())
0
2661
by: Andy B | last post by:
I wanted to try out the ado.net entity framework model and see how it was different from linq to sql entities. I put a page in a web application project, added an ado.net entity model and told it to generate the model from existing database, went back to my empty page and put a GridView on it. I right clicked on the GridView and went to show...
1
4785
by: Kurt Jakobsen | last post by:
Hi, I have problem opening an MySql connection from an win console application. I am using SharpDevelop as IDE. Previously I've been working with MySql through C# aspx and am new to writing exe programs in C#, so I assume that I might be missing something in the IDE / project configuration. I am successfully opening a connection and reading...
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.