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
39
votes
8 answers

Array.Join in .Net?

Ok, this is a dumb thing that I'm sure I've done dozens of times but for some reason I can't find it. I have an array... And want to get a string with the contents of that array separated by a delimited... Where is the .Join() method that I can't…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
39
votes
5 answers

How to call a VBScript file in a C# application?

I need to call a VBScript file (.vbs file extension) in my C# Windows application. How can I do this? There is an add-in to access a VBScript file in Visual Studio. But I need to access the script in code behind. How to do this?
balaweblog
  • 14,982
  • 28
  • 73
  • 95
39
votes
4 answers

Determine which w3wp.exe process belongs to which App Pool in Windows 7 / IIS7.5?

I've recently upgraded my development machine from Windows XP to Windows 7. How can I tell which w3wp.exe process belongs to which App Pool on a desktop running Windows 7? On a server running IIS6, you can run c:\windows\system32\cscript…
wweicker
  • 4,833
  • 5
  • 35
  • 60
38
votes
4 answers

How to change the mouse cursor into a custom one when working with Windows Forms applications?

In a UserControl I want to change the mouse cursor from the arrow, to a hand icon. What I currently do is this: this.Cursor = Cursors.Hand; This is very nice, it gives me a mouse cursor looking like this: But here comes my problem... this shows a…
Bart Gijssens
  • 1,572
  • 5
  • 20
  • 38
37
votes
1 answer

XmlReader - Self-closing element does not fire a EndElement event?

I am using XmlReader in .NET to parse an XML file using a loop: while (xml.Read()) { switch xml.NodeType { case XmlNodeType.Element: //Do something case XmlNodeType.Text: //Do something case XmlNodeType.EndElement: …
Vincent
  • 22,366
  • 18
  • 58
  • 61
37
votes
7 answers

How to unit test if my object is really serializable?

I am using C# 2.0 with Nunit Test. I have some object that needs to be serialized. These objects are quite complex (inheritance at different levels and contains a lot of objects, events and delegates). How can I create a Unit Test to be sure that my…
Pokus
  • 11,383
  • 11
  • 37
  • 27
36
votes
13 answers

Running .net based application without .NET Framework

Is there a way to run .net based applications without .net framework installed. Is there a way to do this. Is there a software that can achive this. Commercial software is also possible. Added: Has anyone any experience with VMWare thin client?
crauscher
  • 6,528
  • 14
  • 59
  • 85
36
votes
4 answers

How can I create an instance of an arbitrary Array type at runtime?

I'm trying to deserialize an array of an type unknown at compile time. At runtime I've discovered the type, but I don't know how to create an instance. Something like: Object o = Activator.CreateInstance(type); which doesn't work because there is…
CrashCodes
  • 3,237
  • 12
  • 38
  • 42
36
votes
7 answers

Strange Error - CS0012: The type x is defined in an assembly that is not referenced

The type 'x' is defined in an assembly that is not referenced. You must add a reference to assembly 'abc123'. I have a .NET 2.0 web application that references my assembly 'abc123'. The assembly exists in the GAC and I've verified that it is the…
Mike T
  • 415
  • 2
  • 5
  • 9
35
votes
7 answers

System.ValueType Understanding

I tried to create a ValueType. I understand that creating a struct would help me. I also tried to derive a type from System.ValueType which is an abstract class. But I got a compiler error message ".. cannot derive from special class…
SaravananArumugam
  • 3,680
  • 6
  • 33
  • 45
34
votes
7 answers

What is the best way to store pairs of strings, make an object or use a class in .NET?

Don't know whether I'm having a "thick day" - but I just wondered what is the best route here. Context: I have a list of fields and I want to store alias names with them (I'm using .NET 2.0 BTW) e.g. So its essentially a pair of…
Vidar
  • 6,548
  • 22
  • 66
  • 96
33
votes
17 answers

How to show text in combobox when no item selected?

C# & .Net 2.0 question (WinForms) I have set of items in ComboBox and non of them selected. I would like to show a string on combo "Please select item" in that situation. Current implementation is just added empty item with such text on index 0 and…
jotbek
  • 1,479
  • 3
  • 14
  • 22
32
votes
12 answers

How do I select all items in a listbox on checkbox checked?

I need to select all items in a ListBox when a CheckBox is clicked. Is it possible to select all items in the ListBox using a single line of code? Or will I have to loop through all items and set selected to true for each one of them?
Rashmi Pandit
  • 23,230
  • 17
  • 71
  • 111
32
votes
4 answers

Best method to obfuscate or secure .Net assemblies

I'm looking for a technique or tool which we can use to obfuscate or somehow secure our compiled c# code. The goal is not for user/data security but to hinder reverse engineering of some of the technology in our software. This is not for use on the…
Curtis
  • 1,189
  • 2
  • 11
  • 22
32
votes
6 answers

Load vs. Shown events in Windows Forms

Hopefully I'm just missing something obvious, but I'm trying to get my head around the differences between the Load and the Shown events in Windows Forms. Traditionally, I've only used Load (or actually OnLoad, since I think it's cleaner to override…
Miral
  • 12,637
  • 4
  • 53
  • 93