tagged [.net-4.0]
Should I always use Parallel.Foreach because more threads MUST speed up everything?
Should I always use Parallel.Foreach because more threads MUST speed up everything? Does it make sense to you to use for every normal foreach a parallel.foreach loop ? When should I start using parall...
- Modified
- 6 Jan at 14:5
Return custom values from WPF dialog
Return custom values from WPF dialog I am using `Window.ShowDialog()` method to fetch some values from the user. However, the dialog will only return a nullable bool. How can I get my WPF window to re...
How can i open a url in web browser (such as IE) and pass credentials
How can i open a url in web browser (such as IE) and pass credentials I want to open a page that required Basic authentication. I want to pass the Basic authentication header to the browser along with...
How to abort a Task like aborting a Thread (Thread.Abort method)?
How to abort a Task like aborting a Thread (Thread.Abort method)? We could abort a `Thread` like this: But can I abort a `Task` (in .Net 4.0) in the same way not by cancellation mechanism.
- Modified
- 2 Jun at 19:53
File compression in .net framework 4.0 c#
File compression in .net framework 4.0 c# Are there any built-in classes/examples for version 4.0 to compress specific files from a directory? I found an example on MSDN which uses the compression cla...
SAP Crystal Reports runtime for .Net 4.0 (64-bit)
SAP Crystal Reports runtime for .Net 4.0 (64-bit) I need a runtime for SAP Crystal Reports for .Net 4.0 (64-bit). I have been searching from the web but not getting any success. Can I get the URL from...
- Modified
- 6 Jul at 05:29
MembershipProvider in .NET 4.0
MembershipProvider in .NET 4.0 How can I add the MembershipProvider class to my .NET 4.0 project in VS 2010 B2? I want to customize a MembershipProvider, but I cannot without adding this class. Please...
- Modified
- 24 Feb at 18:7
Why can't I cast DateTime[] to object[]?
Why can't I cast DateTime[] to object[]? It seems that I can cast DateTime to object, so why can't I cast array DateTime[] to object[]? I know this has something to do with value/reference types, but ...
Calc utf-8 string size in bytes?
Calc utf-8 string size in bytes? I have a string of `utf8`. I need to get its size. ( bytes) Does it always `x2` ? is there any .net function for this ? p.s. [question](https://stackoverflow.com/quest...
.NET Dock Panel?
.NET Dock Panel? Trying to find a dock panel/window widget like Visual Studio uses for its Toolbox/Properties/Solution Explorer/etc windows. Is there seriously not one already part of the .net framewo...
ValidateRequest="false" doesn't work in Asp.Net 4
ValidateRequest="false" doesn't work in Asp.Net 4 I have a form at which I use ckeditor. This form worked fine at Asp.Net 2.0 and 3.5 but now it doesn't work in Asp.Net 4+. I have ValidateRequest="fal...
- Modified
- 4 Jun at 08:52
System.MissingMethodException Int32 System.Environment. get_CurrentManagedThreadId()
System.MissingMethodException Int32 System.Environment. get_CurrentManagedThreadId() What could cause the following exception? This method call seems to be generated by C# compiler for methods yieldin...
Data-driven testing in NUnit?
Data-driven testing in NUnit? In MSTest you can do something like: What is the equivalent code in N
- Modified
- 12 Apr at 13:45
Clear the current content from a Frame?
Clear the current content from a Frame? I was wondering how you are meant to remove the current content from a frame and make it so it is not displaying anything? Also I would like to know how you are...
What is wrong with ToLowerInvariant()?
What is wrong with ToLowerInvariant()? I have the following line of code: VS 2010 code analysis is telling me the following: > Warning 7 CA1308 : Microsoft.Globalization : In method ... replace the ...
XmlSerialize an Enum Flag field
XmlSerialize an Enum Flag field I have this : I want to Xml serialize Formulaire If I init : `_infoAbonne = InfoAbonne.name | InfoAbonne.email;` In my Xml Result I get only : `
- Modified
- 23 Jan at 11:27
Is there a way to do a PUT with WebClient?
Is there a way to do a PUT with WebClient? with the WebClient class in .NET 4.0, is there a way to do a PUT? I know you can do a GET with DownloadString() and a POST with UploadString(), but is there ...
Default for generic type?
Default for generic type? Is it possible to do something like (note the `=int`) ? Before you suggest it, yes, I know I can just add another line: But I'm wondering if it's possible to do it as a param...
How to check if a generic parameter is dynamic in .NET 4.0
How to check if a generic parameter is dynamic in .NET 4.0 I have a class `ObjectMapper` . Is there any way in .NET 4.0 to tell if `typeof(T)` is `dynamic`? I want to be able to determine inside a mem...
lowering priority of Task.Factory.StartNew thread
lowering priority of Task.Factory.StartNew thread a code like below will start a new thread to do the job. Is there any way I can control the priority of that thread?
- Modified
- 29 Jan at 22:39
In .NET 4, does BeginInvoke and Task use the same threadpool?
In .NET 4, does BeginInvoke and Task use the same threadpool? .NET 4 introduced a brand new thread pool design accessed by the Task Parallel library. But if I have old code that uses Delegate.BeginInv...
- Modified
- 10 Mar at 19:32
DotNetZip - rename file entry in zip file while compressing
DotNetZip - rename file entry in zip file while compressing Using DotNetZip, is it possible to compress a file such that the zip lists a different file name for a file than the file name on disk? For ...
Getting the connectionstring in .net 4
Getting the connectionstring in .net 4 I want to get a connection string from the `app.config` file. `connectionString = System.Configuration.ConfigurationSettings.AppSettings["DBEntities"];` But it d...
- Modified
- 26 Apr at 17:54