Error at constructor for SqlConnection

R

RvGrah

My program is giving a strange exception at startup, only on client
machines. Runs fine on development machine. The app was upgraded long
ago from a 2003 version to a VS2005 version, but continued to run fine
until just a couple of weeks ago. Now new builds give the error when
the code hits:
SqlConnection cn = new SqlConnection();

The error is:
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnection' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnectionFactory' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. --->
System.PlatformNotSupportedException: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Security.Principal.SecurityIdentifier..ctor(WellKnownSidType
sidType, SecurityIdentifier domainSid)....

If the new connection was generated at the form's class level, it would
crash before even tring to load the form, it's only by moving the
constructor to the form's Load procedure that I could see this error
code explicitly. I've tried various things to make sure the references
are correct, and the code and references all seem similar to me to
other programs that run fine on the same clients.

Anybody have more info on this?

Bob Graham
 
S

Samuel R. Neff

This seems like a pretty clear error message...
System.PlatformNotSupportedException: This operation is only supported
on Windows 2000 SP3 or later operating systems.

what are your clients running?

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
 
B

Bob Graham

The client machines are all XP Pro SP2!!!

Not the issue at all, the error message is misleading. I should probably
have mentioned that I included it for informational purposes for any that
may have experienced the same situation. I believe it has something to do
with having been upgraded from a .net 1.1 app a long time ago, I just have
no clue as to why the builds from this code base would only now start
causing errors on client machines when I upgraded the code almost a year
ago...

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top