Questions tagged [.net-3.5]

The 3.5 version of the .NET Framework, which is based on the 2.0 .NET Framework with extra assemblies (including 3.0). Use for questions specifically related to .NET Framework 3.0. For questions on .NET Framework generally, use the .net tag.

The 3.5 version of the Microsoft .NET Framework, which is based on the 2.0 .NET Framework. In addition, it installs .NET Framework 2.0 SP1, (installs .NET Framework 2.0 SP2 with 3.5 SP1) and .NET Framework 3.0 SP1 (installs .NET Framework 3.0 SP2 with 3.5 SP1).

What's New in .NET Framework 3.5
.NET Framework 3.5 System Requirements

Released by Microsoft Corporation
Version Number: 3.5.21022.8
Release Date: 2007-11-19

5938 questions
61
votes
8 answers

LINQ on the .NET 2.0 Runtime

Can a LINQ enabled app run on a machine that only has the .NET 2.0 runtime installed? In theory, LINQ is nothing more than syntactic sugar, and the resulting IL code should look the same as it would have in .NET 2.0. How can I write LINQ without…
urini
  • 32,483
  • 14
  • 40
  • 37
60
votes
6 answers

Embedding one dll inside another as an embedded resource and then calling it from my code

I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible. This with is C# and .NET…
Redwood
  • 66,744
  • 41
  • 126
  • 187
60
votes
5 answers

LINQ: Dot Notation vs Query Expression

I am beginning to use LINQ in general (so far toXML and toSQL). I've seen that sometimes there are two or more ways to achieve the same results. Take this simple example, as far as I understand both return exactly the same thing: SomeDataContext dc…
Martin Marconcini
  • 26,875
  • 19
  • 106
  • 144
59
votes
5 answers

Is it possible to bind a Canvas's Children property in XAML?

I'm a little surprised that it is not possible to set up a binding for Canvas.Children through XAML. I've had to resort to a code-behind approach that looks something like this: private void UserControl_Loaded(object sender, RoutedEventArgs e) { …
Rob
  • 25,984
  • 32
  • 109
  • 155
59
votes
6 answers

Equivalent of Tuple (.NET 4) for .NET Framework 3.5

Is there a class existing in .NET Framework 3.5 that would be equivalent to the .NET 4 Tuple? I would like to use it in order to return several values from a method, rather than create a struct.
Otiel
  • 18,404
  • 16
  • 78
  • 126
59
votes
16 answers

Error when using extension methods in C#

I came across an issue that makes me think there is bug in the 3.0 framework. When I try to use extension methods I get the following error: Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' When using…
Korbin
  • 1,788
  • 2
  • 18
  • 29
58
votes
14 answers

How can I convert an integer into its verbal representation?

Is there a library or a class/function that I can use to convert an integer to it's verbal representation? Example input: 4,567,788` Example output: Four million, Five hundred sixty-seven thousand, seven hundred eighty-eight
Malfist
  • 31,179
  • 61
  • 182
  • 269
57
votes
7 answers

How to remove a suffix from end of string?

I want to: Check a variable and determine if the last 2 characters are "Id" If yes, remove them. I can do it with this below, but then it will blow up if there is an "Id" substring other than the end. Is there a RemoveFromEnd() method that takes…
leora
  • 188,729
  • 360
  • 878
  • 1,366
57
votes
3 answers

Shortest way to create a List of a repeated element

With the String class, you can do: string text = new string('x', 5); //text is "xxxxx" What's the shortest way to create a List< T > that is full of n elements which are all the same reference?
xyz
  • 27,223
  • 29
  • 105
  • 125
56
votes
5 answers

Using LINQ to convert List to List

I have 2 classes which have some identical properties. I stock into a list properties from 1st class, and after that, I want to take some needed properties and put them into a list of 2nd class type. I've made cast sequence through C# and that runs…
mihai
  • 2,746
  • 3
  • 35
  • 56
55
votes
8 answers

What to use: var or object name type?

this is a question that when programming I always wonder: What to use when we are writing code: var myFiles = Directory.GetFiles(fullPath); or string[] myFiles = Directory.GetFiles(fullPath); var is new and is a Implicitly Typed Local Variables,…
balexandre
  • 73,608
  • 45
  • 233
  • 342
55
votes
3 answers

someString.IndexOf(someString) returns 1 instead of 0 under .NET 4

We have recently upgraded all our projects from .NET 3.5 to .NET 4. I have come across a rather strange issue with respect to string.IndexOf(). My code obviously does something slightly different, but in the process of investigating the issue, I…
knersis
  • 585
  • 5
  • 13
53
votes
7 answers

Getting the date of a .NET assembly

How can I retrieve the Created date from the current .NET assembly? I'd like to add some realy simple functionality where my app stops working one week after the build date of the main assembly. I already wrote the code that kills my app after a…
DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233
52
votes
2 answers

Can I make a generic optional, defaulting to a certain class?

My question is related to Is there a reasonable approach to "default" type parameters in C# Generics?, but using an inner generic class that approach doesn't work. Given code like this: using System; public class FooEventArgs : EventArgs { …
Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
52
votes
7 answers

Explanation why IEnumerable is more efficient than a List

I keep hearing that in .net 3.5 you should use IEnumerable over a List, but I can’t find any reference materials or articles that explain why it’s so much more proficient. Does anyone know of any content that explains this? The purpose of asking…
Zaffiro
  • 4,834
  • 5
  • 36
  • 47