Questions tagged [.net-4.0]

Version 4.0 of the .NET Framework. Use for questions specifically related to .NET Framework 4.0. For questions on .NET Framework generally, use the .net tag.

Released on April 12th, 2010, version 4.0 (4.0.30319.1) of the Microsoft .NET Framework contains numerous enhancements, new features and bug fixes.

What's New in the .NET Framework 4

Language Improvements

Base Class Library (BCL) additions:

For more information about the new features, see:

8834 questions
5
votes
4 answers

C# - Create Dictionary>

I have a generic class named Manager, and I want to create a dictionary that maps a type to an instance of the Manager class of this type. I thought about creating a Dictionary class that derives from Dictionary, but overriding all of its methods…
user963395
5
votes
1 answer

System.Runtime.Caching doesn't release BitmapImage objects

I'm using the new System.Runtime.Caching library for caching in my application, and defined it as follows in the App.config:
Adi Lester
  • 24,731
  • 12
  • 95
  • 110
5
votes
1 answer

MVC 3 Editor Template with Dynamic Drop Down

How do I get the drop down to display as part of my editor template? So I have a Users entity and a Roles entity. The Roles are passed to the view as a SelectList and User as, well, a User. The SelectList becomes a drop down with the correct ID…
5
votes
2 answers

Unmanaged callback causing stack to overflow

I am working with an unmanaged resource with C#. The resource exposes a callback that can be setup for certain events that could happen within the hardware. To gain access to the unmanaged functions I do the…
Lux782
  • 451
  • 1
  • 4
  • 5
5
votes
3 answers

Which account does asp.net need permissions setting on in .net 4 on Win7?

I've been stuck working on XP Pro for what seems like forever and only recently switched to Win 7. Running IIS 7.5 I find it really confusing as to which account needs access these days to allow a ASP.NET website to run/read/write etc. I end up…
Pete Duncanson
  • 3,208
  • 2
  • 25
  • 35
5
votes
1 answer

Adding a progress bar to the background of a WPF control

How can I modify certain WPF controls (i.e. combobox, textbox, etc) to have a progressbar in the background of the control (which I can enable and disable on demand). I don't need it to actually show an accurate progress, rather I just need an…
user981225
  • 8,762
  • 6
  • 32
  • 41
5
votes
6 answers

Using SequenceEqual and then returning which elements don't match

I have two List and I am using the SequenceEqual method to determine if they match. I now have a need to get a List, string, IEnumerable, whatever of the indexes of the elements that have failed. Is there an easy way? Thanks
Jon
  • 38,814
  • 81
  • 233
  • 382
5
votes
2 answers

How to automate clean up of ToolTip in UserControl

I've been tracking down a memory leak and I've narrowed it down to a ToolTip that is allocated in a UserControl-derived class. The ToolTip is allocated in the allocated in the control's constructor and initialized in the Load event like this: public…
Avalanchis
  • 4,500
  • 3
  • 39
  • 48
5
votes
3 answers

Is there a good way to extend a WCF service using basicHttpBinding to also allow REST service communicating with JSON?

We have a web service up and running built in VS2010. Several of the operational contracts looks like this: [OperationContract] ITicket Login(string userName, byte[] passwordHash, string softwareVersion); I.e. they booth have complex…
nj.
  • 756
  • 1
  • 5
  • 21
5
votes
2 answers

AutoFac: What does PropertyWiringFlags.AllowCircularDependencies do?

I have part of a code that has dependencies that look as follows: public class MyPage : Page //ASPX WebForms page { public IPersonBl PersonBl { get; set; } } public class PersonBl : IPersonBl { public PersonBl(ISomeMagicBl…
Juri
  • 32,424
  • 20
  • 102
  • 136
5
votes
3 answers

C# Determine remote desktop login user's computer name

I have been researching for a couple of weeks now, on and off, on how to determine the computer name of the user that is logged in via remote desktop. I have an application that users run on a terminal server environment, and I would like to capture…
Dave Thompson
  • 617
  • 1
  • 8
  • 17
5
votes
1 answer

Has extending static classes using extension methods been made possible in .NET 4.0+?

I have read that it is possible to extend static classes in F#, though it was not yet possible in C#. Multiple workarounds are proposed and therefore suggesting that this type of extension could be reasonably useful. Though the extension methods are…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
5
votes
6 answers

Microsoft.Expression.Drawing.Aero missing (what is it?!)

I have a window and I created a "callout" there. When I try to create the new window with this.InitializeComponent(); I get an exception: The assembly with display name 'Microsoft.Expression.Drawing.Aero' failed to load in the 'Load' binding…
user1032412
  • 75
  • 1
  • 7
5
votes
2 answers

Would the following pattern of unsubscribing your self from an event via closure cause any problems?

Consider the situation in which you want to subscribe to an event for one and only one notification. Once the first notification lands, you unsubscribe from all future events. Would the following pattern present any memory issues? It works, but I…
Matt
  • 41,216
  • 30
  • 109
  • 147
5
votes
2 answers

Can't understand the Exception when using dynamic with generic collection in .net4

check the code below please: static void Main(string[] args) { IList items = new List(); items.Add(3); items.Add("solid"); dynamic i = new ExpandoObject(); items.Add(i);…
Inside
  • 53
  • 5