Questions tagged [.net-2.0]

The 2.0 version of the .NET Framework. For questions on .NET Framework generally, use the .net tag.

The 2.0 version of the .NET Framework.

What's New in the .NET Framework 2.0
.NET Framework 2.0 System Requirements

Released by Microsoft Corporation
Version Number: 2.0.50727.42
Release Date: 2005-11-07

2578 questions
27
votes
6 answers

Nunit.exe cannot work on Vista 64bits if x86 build

I am on Vista 64 bits and I have a project built with x86 configuration. All work fine. Now, we are at the time to create test. We have NUnit 2.4.8 but we have a lot of problem. The test are loading trough the Nunit.exe (gui) when we select the .dll…
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
27
votes
7 answers

Why do people consistently recommend using appConfig instead of using Settings files? (.NET)

Very often I see the answer to the question like: "How should I store settings in my .NET app?" is to edit the app.config file by manually adding entries to the app.config (or web.config) like so: **
blak3r
  • 16,066
  • 16
  • 78
  • 98
26
votes
3 answers

How to tell if the OS is Windows XP or higher?

I am trying to play with the Environment.OSVersion.Version object and can't really tell what version would indicate that the OS is Windows XP or higher (e.g. I want to exclude Windows 2000, ME or previous versions).
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
26
votes
6 answers

Allow multi-select in a .NET TreeView

I'm stuck in .NET 2.0 Windows Forms. It doesn't look like the ability to select multiple nodes exists in the standard TreeView control. I'm trying to do this for a context menu selection. So check boxes aren't an acceptable UI paradigm here. What's…
Darcy Casselman
  • 2,574
  • 3
  • 24
  • 26
26
votes
2 answers

How to fail a test that is stuck in an infinite loop?

I have some code that produces an infinite loop. Now I need to write a test that will fail after about 200ms. 200ms will indicate that the code is in the infinite loop. For example: public void CodeUnderTest() { while(true) { } }
O.O
  • 11,077
  • 18
  • 94
  • 182
25
votes
6 answers

How to convert a String[] to int[] in C# and .NET 2.0?

I've got : string[] strArray = new string[3] { "1", "2", "12" }; And I want something like this int[] intArray = Convert.toIntArray(strArray); I work int C# .net v2.0, I don't want to write a lot of code. How can I do that? Thank you.
Christophe Debove
  • 6,088
  • 20
  • 73
  • 124
25
votes
5 answers

Execute javascript function after asp.net postback without Ajax

I wish to execute a javascript function after asp.net postback with out using ajax. I've tried the following in my even method with no luck: Page.ClientScript.RegisterStartupScript(GetType(), "ShowPopup", "showCheckOutPopIn('Livraison',556);");
Alexandre Brisebois
  • 6,599
  • 12
  • 50
  • 69
25
votes
2 answers

Can .NET 4.0 code interoperate with .NET 2.0 code?

Are there compatibility barriers with a .NET 4.0 assembly calling code in a .NET 2.0 assembly? And vice versa? More specifically, I'm investigating an upgrade to Visual Studio 2010 when using a third party application based on .NET 2.0. The…
spoulson
  • 21,335
  • 15
  • 77
  • 102
25
votes
2 answers

How to sort an array containing class objects by a property value of a class instance?

Possible Duplicate: How to sort an array of object by a specific field in C#? Given the following code: MyClass myClass; MyClassArray[] myClassArray = new MyClassArray[10]; for(int i; i < 10; i++;) { myClassArray[i] = new myClass(); …
Mr. Smith
  • 5,489
  • 11
  • 44
  • 60
24
votes
1 answer

Right way to get username and password from connection string?

I have a connection string like this: "SERVER=localhost;DATABASE=tree;UID=root;PASSWORD=branch;Min Pool Size = 0;Max Pool Size=200" How do I get the various database parameters out of it? I can get database name and server like this: serverName =…
nawfal
  • 70,104
  • 56
  • 326
  • 368
24
votes
4 answers

Registry Watcher C#

I'm a newbie to WMI and I need to implement RegistryValueChangeEvent in a C# service. I need an event handler that gets triggered each time any one of a set of registry values is changed. I want behavior similar to the FileSystemWatcher class's…
Andrew Ensley
  • 11,611
  • 16
  • 61
  • 73
24
votes
3 answers

When linking a .NET 2.0 Managed Assembly from a .NET 4.0 Application, which framework is used?

If I have a 2.0 CLR assembly (pure managed code, no mixed mode issues) that I need to link to from a 4.0 CLR Application, does the 2.0 code run on the 2.0 CLR or 4.0. Basically, is there any risk of 4.0 breaking changes affecting the 2.0 code?
AlexWilson
  • 1,179
  • 1
  • 9
  • 16
24
votes
4 answers

How to get efficient Sql Server deadlock handling in C# with ADO?

I have a class 'Database' that works as a wrapper for ADO.net. For instance, when I need to execute a procedure, I call Database.ExecuteProcedure(procedureName, parametersAndItsValues). We are experiencing serious problems with Deadlock situations…
Victor Rodrigues
  • 11,353
  • 23
  • 75
  • 107
24
votes
4 answers

Invoke() is blocking

From time to time my applications GUI stops redrawing. There a lot of threads that are firing all kinds of events (like timers or network data ready etc.). Also there are a lot of controls that are subscribing these events. Because of that, all the…
EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
24
votes
2 answers

Search XML file for nodes with specific attribute value in .NET 2

I found answers for searching XML nodes using LINQ, but I am limited to C# with .NET 2. I want to open a single XML file (~50Kb, all simple text) and search for all nodes with attribute name having a specific value. It seems like…
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589