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
2 answers

ASP.NET Web Service Application in .net 4

I was going through the MSDN walkthrough on using client application services. http://msdn.microsoft.com/en-us/library/bb546195.aspx This is for .net 3.5..but i need to do it in .net 4. The thing is that it doesn't have any ASP.NET Web Service…
Dimith
  • 379
  • 2
  • 12
5
votes
3 answers

Calculate the average TimeSpan between a collection of DateTimes

Let's say we're tracking the times when a user is performing a certain action, and we want to know the average time between said actions. For example, if the user performed this action at these times: today, 1 PM today, 3 PM today, 6 PM The result…
adamjford
  • 7,478
  • 6
  • 29
  • 41
5
votes
3 answers

"Please Wait" message using jQuery or AJAX?

I am creating an enterprise web template to be used for development of all our web applications. Many of our existing applications take a while to load because of the amount of data and geographic distance of the data source, so users frequently…
Devin Burke
  • 13,642
  • 12
  • 55
  • 82
5
votes
4 answers

Can I use a .NET 4 feature while targeting .NET 3.5 SP1?

I would like to use some of the features in .NET 4.0 but still target .NET 3.5 within Visual Studio 2010. Basically I want to have something like: if (.NET 4 installed) then execute .NET 4 feature This is an optional feature, and I would just…
Luke
  • 6,195
  • 11
  • 57
  • 85
5
votes
1 answer

Send a report directly to printer with Reporting Services

I want to print a report from a button click. I just don't need (in fact, I don't want) to view the report before printing. Just pass some parameters and send it to printer (doesn't matter if it's with or without a print dialog).
Vitor Reis
  • 989
  • 4
  • 24
  • 45
5
votes
5 answers

Optimizing large switch statement

I have large switch statement in which I create UIElements based on input value from XElement: public static UIElement CreateElement(XElement element) { var name = element.Attribute("Name").Value; var text =…
Vale
  • 3,258
  • 2
  • 27
  • 43
5
votes
1 answer

Distinguish between getter-only property and expression body property?

Is it possible, using reflection, to distinguish between a getter-only property and an expression body property? class MyClass { DateTime GetterOnly { get; } DateTime ExpressionBody => DateTime.Now; } For example, how could the method…
Suraj
  • 35,905
  • 47
  • 139
  • 250
5
votes
2 answers

Error FileAccessDenied (JET_errFileAccessDenied, Cannot access file, the file is locked or in use)

I am trying to deploy Raven DB to my site running .Net 4 in integrated mode (site was previously used to host ASP.Net MVC 3 site. My configuration file is this:
Jesper Lund Stocholm
  • 1,973
  • 2
  • 27
  • 49
5
votes
4 answers

How can I use TypeConverters with a ConfigurationSection?

So I've got a ConfigurationSection/ConfigurationElementCollection that has a configuration like this: And here is how I handle the mimeFormats: public class MimeFormatElement:…
5
votes
1 answer

Validation Error Template Adorner is cut insight a ScrollViewer

i have the following problem. as far a i put my Textboxes in a scrollviewer my ValidationError Adorner get cut by the ScrollViewer. i found some answers to Adorner and ScrollViewer which say i need to retemplate my scrollviewer and add an…
blindmeis
  • 22,175
  • 7
  • 55
  • 74
5
votes
3 answers

Why is VBA's VarType function saying this COM object is a string? (Object is instance of COM version of .NET's System.Object class.) Is it a bug?

Question summary When I use VBA's VarType function, passing it an instance of the Object class available in a mscorlib.dll library reference (a .NET library reference), the value returned is 8. According to VBA documentation here, this means the…
5
votes
3 answers

Moving constants to a separate assembly

I have a project which utilizes many global constants. Eventually I am planning to extract some parts of the program and create assemblies of its own. Is it worthy (or is it possible?) to create an assembly for global constants alone (viz,…
logeeks
  • 4,849
  • 15
  • 62
  • 93
5
votes
1 answer

How to return data from a Threading Task

I am currently trying to use a .net Task to run a long method. I need to be able to return data from the task. I would like to call this method multiple times each time running it in a new task. However, returning data using the Task.Result…
Web
  • 1,735
  • 2
  • 22
  • 36
5
votes
7 answers

Is there a way to continuously mirror the result of Console.Write to a collection (array,list,etc)?

I have a console program, I'd like to continuously mirror the result of Console.Write to a collection, which I can look at the tail of in real time. The collection could be an array, a list, etc. I assume I'd have to use some sort of event…
Contango
  • 76,540
  • 58
  • 260
  • 305
5
votes
1 answer

What are these random characters in my URL and how did they get there?

https://xxx.xxx.xxx.xxx/AppName/(S(fuzxravpfxmtjtifjcd5dt0n))/Views/Reports/Page01.aspx What are the characters between /AppName/ and /Views/ and how did they get into my url? The url is actually…
DenaliHardtail
  • 27,362
  • 56
  • 154
  • 233
1 2 3
99
100