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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp); // <-- crashes here #1

2. SqlConnection con = new SqlConnection("Persist Security
Info=False;server=MyServer\\MyInstance;database=MyDataBase;Connect
Timeout=30;Trusted_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\user123.xCOMPANY\Local Settings\Apps\2.0\HMTCX95T.RXV
\9CKLQ85R.AXB
\appl..tion_6e98555c88572fe0_0001.0002_47eaa25a8a47e226\TestSPExecTestSPExecTestSPExecTestSPExec.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\user123.xCOMPANY\Local Settings\Apps\2.0\HMTCX95T.RXV
\9CKLQ85R.AXB\TestSPExecTestSPExecTestSPExec.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!
.



Relevant Pages

  • Re: Connection issues between .Net framwok and SQl Express 2005
    ... You will no longer need the database MDF file name in the connection string. ... simply attach the ASPNETDB.mdf to SQL Server permenantly, ... as USER INSTANCE on existing SQL Server Express, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Performance of ODBC
    ... if you have a software firewall; forward 1433/1434 to your server ... I've now created my own server with SQL Server 2005 Express, ... glitch concerns the Upsizing Wizard. ... I originally set up my ODBC connection via ...
    (microsoft.public.access.adp.sqlserver)
  • SQL 2005 Express and VS .Net 2003 wizard error More options
    ... Open the server explorer panel ... Go to the Provider tab and select SQL NAtive Client (DON'T use oledb ... Go back to the Connection tab and carry on setting up the connection ... I have installed Visual Studio 2005 Professional and then Visual Studio ...
    (microsoft.public.sqlserver)
  • Re: Timeout problem with SS2K, VS03
    ... I noticed calls in sql profiler: ... This is the server side debug stored procedure. ... a timeout issue that I cannot identify the source of. ... transaction is committed and the connection is closed cleanly and all ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cannot connect to SQL Express on 2003 Machine from XP machine
    ... listening on UDP 1434 using netstat -abn, ... And i double checked the connection string, and i did have it the right ... But I have another 2000 server that I can connect to fine, ... I am trying to connect from an XP SP2 machine remotely to a SQL Express ...
    (microsoft.public.sqlserver.connect)