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
369
votes
19 answers

XmlSerializer - There was an error reflecting type

Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passing that into the constructor: XmlSerializer serializer = new XmlSerializer(typeof(DataClass)); I am…
leora
  • 188,729
  • 360
  • 878
  • 1,366
313
votes
16 answers

Is there an alternative to string.Replace that is case-insensitive?

I need to search a string and replace all occurrences of %FirstName% and %PolicyAmount% with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me from using the String.Replace() method. I've seen…
Aheho
  • 12,622
  • 13
  • 54
  • 83
295
votes
31 answers

How to detect Windows 64-bit platform with .NET?

In a .NET 2.0 C# application I use the following code to detect the operating system platform: string os_platform = System.Environment.OSVersion.Platform.ToString(); This returns "Win32NT". The problem is that it returns "Win32NT" even when running…
Marc
  • 9,012
  • 13
  • 57
  • 72
252
votes
40 answers

Invalid postback or callback argument. Event validation is enabled using ''

I am getting the following error when I post back a page from the client-side. I have JavaScript code that modifies an asp:ListBox on the client side. How do we fix this? Error details below: Server Error in '/XXX'…
Julius A
  • 38,062
  • 26
  • 74
  • 96
251
votes
9 answers

How do I get and set Environment variables in C#?

How can I get Environnment variables and if something is missing, set the value?
Mister Dev
  • 10,021
  • 12
  • 41
  • 33
239
votes
14 answers

Editing dictionary values in a foreach loop

I am trying to build a pie chart from a dictionary. Before I display the pie chart, I want to tidy up the data. I'm removing any pie slices that would be less than 5% of the pie and putting them in a "Other" pie slice. However I'm getting a…
Aheho
  • 12,622
  • 13
  • 54
  • 83
187
votes
8 answers

Compression/Decompression string with C#

I am newbie in .net. I am doing compression and decompression string in C#. There is a XML and I am converting in string and after that I am doing compression and decompression.There is no compilation error in my code except when I decompression my…
Mohit Kumar
  • 2,019
  • 2
  • 17
  • 14
168
votes
2 answers

datetime.parse and making it work with a specific format

I have a datetime coming back from an XML file in the format: 20080916 11:02 as in yyyymm hh:ss How can I get the datetime.parse function to pick up on this? Ie parse it without erroring?
anonym0use
  • 2,936
  • 4
  • 25
  • 26
151
votes
10 answers

How to create a simple proxy in C#?

I have downloaded Privoxy few weeks ago and for the fun I was curious to know how a simple version of it can be done. I understand that I need to configure the browser (client) to send request to the proxy. The proxy send the request to the web (let…
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
109
votes
3 answers

Show control hierarchy in the WinForms designer

One of our clients has an old WinForms application that contains forms with a lot of controls on them. Some of those controls have a deep hierarchy and that makes it to hard to select them in the designer. I need to understand this hierarchy to make…
Cédric V
  • 1,729
  • 2
  • 21
  • 28
106
votes
31 answers

Debugging doesn't start

When I hit F5 (debugging mode) nothing happens. Building works correctly, exe file I can launch properly, but can't start debug. Why?
Saint
  • 5,397
  • 22
  • 63
  • 107
106
votes
4 answers

Can I control the location of .NET user settings to avoid losing settings on application upgrade?

I'm trying to customize the location of the user.config file. Currently it's stored with a hash and version number %AppData%\[CompanyName]\[ExeName]_Url_[some_hash]\[Version]\ I want to it be agnostic to the version of the…
Muxa
  • 5,563
  • 6
  • 46
  • 56
97
votes
8 answers

How should you diagnose the error SEHException - External component has thrown an exception

Whenever a user reports an error such as System.Runtime.InteropServices.SEHException - External component has thrown an exception? is there anything that I as a programmer can do to determine the cause? Scenario : One user (using a program my…
sgmoore
  • 15,694
  • 5
  • 43
  • 67
95
votes
12 answers

Difference between the System.Array.CopyTo() and System.Array.Clone()

What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
Mister Dev
  • 10,021
  • 12
  • 41
  • 33
91
votes
3 answers

two different DLL with same namespace

I have two DLL files that have the same namespace but they have different methods and types. How can I reference both DLLs in my project and use their methods and types? By the way, these two DLLs have some methods and types with the same name but…
user415789
1
2 3
99 100