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
51
votes
1 answer

Lambda Expression using Foreach Clause

Possible Duplicate: Why is there not a ForEach extension method on the IEnumerable interface? EDIT For reference, here's the blog post which eric referred to in the comments https://ericlippert.com/2009/05/18/foreach-vs-foreach/ ORIG More of a…
Eoin Campbell
  • 43,500
  • 17
  • 101
  • 157
51
votes
1 answer

Bind datagrid column visibility MVVM

.Net 3.5 I know that the columns doesn't inherit the datacontext and by reading other posts i thought this would work: Visibility="{Binding RelativeSource={x:Static RelativeSource.Self}, …
jrb
  • 1,708
  • 2
  • 13
  • 20
51
votes
15 answers

See if user is part of Active Directory group in C# + Asp.net

I need a way to see if a user is part of an active directory group from my .Net 3.5 asp.net c# application. I am using the standard ldap authentication example off of msdn but I don't really see how to check against a group.
mike_h
  • 511
  • 1
  • 5
  • 3
50
votes
4 answers

Guid == null should not be allowed by the compiler

The behaviour described below is specific to .net-3.5 only I just ran across the most astonishing behavior in the C# compiler; I have the following code: Guid g1 = Guid.Empty; bool b1= (g1 == null); Well, Guid is not nullable therefore it can…
Luis Filipe
  • 8,488
  • 7
  • 48
  • 76
50
votes
3 answers

Replacing Process.Start with AppDomains

Background I have a Windows service that uses various third-party DLLs to perform work on PDF files. These operations can use quite a bit of system resources, and occasionally seem to suffer from memory leaks when errors occur. The DLLs are…
MikeWyatt
  • 7,842
  • 10
  • 50
  • 71
48
votes
3 answers

What is the difference between new Action() and a lambda?

So when I write something like this Action action = new Action(()=>_myMessage = "hello"); Refactor Pro! Highlights this as a redundant delegate creation and allows me to to shorten it to Action action = () => _myMessage="hello"; And this usually…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
48
votes
2 answers

Dapper and SQL Injections

How does Dapper help protect against SQL injections? I am testing out different DAL technologies and have to choose one to be secure our site. I'm leaning towards Dapper (http://code.google.com/p/dapper-dot-net/), but need some help learning about…
cdub
  • 24,555
  • 57
  • 174
  • 303
47
votes
1 answer

Is it possible to intercept Console output?

I call a method, say, FizzBuzz(), over which I have no control. This method outputs a bunch of stuff to the Console using Console.WriteLine. Is it possible for me to intercept the output being generated by the FizzBuzz method? Note that my…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
47
votes
34 answers

When creating a new GUI, is WPF the preferred choice over Windows Forms?

Most restrictions and tricks with windows forms are common to most programmers. But since .NET 3.0 there is also WPF available, the Windows Presentation Foundation. It is said that you can make "sexy applications" more easy with it and with .NET 3.5…
Anheledir
  • 4,337
  • 7
  • 32
  • 34
47
votes
5 answers

Inconsistency in divide-by-zero behavior between different value types

Please consider the following code and comments: Console.WriteLine(1 / 0); // will not compile, error: Division by constant zero int i = 0; Console.WriteLine(1 / i); // compiles, runs, throws: DivideByZeroException double d =…
Paul Sasik
  • 79,492
  • 20
  • 149
  • 189
46
votes
2 answers

Can I use the task parallel library in a .Net 3.5 project?

I heard that the Task Parallel Library can be used in a .Net 3.5 project. Is this correct, and if yes, how do I use it? In .Net 4.0, it resides in System.Threading, but when I select .Net 3.5 as the target in Visual Studio 2010, I don't get access…
Mathias
  • 15,191
  • 9
  • 60
  • 92
46
votes
2 answers

Replacing a DataReader with a DataTable

I'm adapting some code that someone else wrote and need to return a DataTable for time's sake. I have code like this: using (SqlCommand command = new SqlCommand(query, conn)) { //add parameters and their values using (SqlDataReader dr =…
cdub
  • 24,555
  • 57
  • 174
  • 303
45
votes
11 answers

Updating your edmx to reflect changes made in your db (.net linq-to-entities)

So I have my edmx made. Then I change my database a little bit, changing a column to from being a NOT NULL to allowing NULL. I go into my edmx, right click and choose "Update Model from Database" Now I go into my program and it hasnt actually…
Stuck In Baghdad
  • 629
  • 2
  • 9
  • 10
45
votes
7 answers

What is a good way to shutdown Threads blocked on NamedPipeServer#WaitForConnection?

I start my application which spawns a number of Threads, each of which creates a NamedPipeServer (.net 3.5 added managed types for Named Pipe IPC) and waits for clients to connect (Blocks). The code functions as intended. private void…
Gishu
  • 134,492
  • 47
  • 225
  • 308
45
votes
8 answers

Workaround for lack of 'nameof' operator in C# for type-safe databinding?

There has been a lot of sentiment to include a nameof operator in C#. As an example of how this operator would work, nameof(Customer.Name) would return the string "Name". I have a domain object. And I have to bind it. And I need names of properties…
Paul Kapustin
  • 3,297
  • 5
  • 35
  • 45