Version 4.5 of the Microsoft .NET Framework. Use for questions specifically related to .NET Framework 4.5. For questions on .NET Framework generally, use the .net tag.
A ZipArchive is a collection of ZipArchiveEntries, and adding/removing "Entries" works nicely.
But it appears there is no notion of directories / nested "Archives". In theory, the class is decoupled from a file system, in that you can create the…
I've previously used BeginAccept() and BeginRead(), but with Visual Studio 2012 I want to make use of the new asynchronous (async, await) features in my socket server program.
How can I complete the AcceptAsync and ReceiveAsync functions?
using…
I've just upgraded my solution to .NETE 4.5 using Target Framework Migrator, and then the package manager console command:
Update-Package -Reinstall -IgnoreDependencies
In one of my projects I am using:
using System.Web.Http.Controllers;
using…
I've been using SqlDependency in a .NET 3.5 application for over 3 years without any problems. The scenario is as follows:
Central windows service with a SqlDependency watching a table (let's call this Table A)
Multiple users using a WPF…
Short version:
The C# code
typeof(string).GetField("Empty").SetValue(null, "Hello world!");
Console.WriteLine(string.Empty);
when compiled and run, gives output "Hello world!" under .NET version 4.0 and earlier, but gives "" under .NET 4.5 and .NET…
I have a .NET project that uses C# in .NET 4.0 and VS2010.
What I would like to do is add some async overloads to my library to make doing async programming easier for users in .NET 4.5 with the await keyword. Right now the methods that are being…
When IReadOnlyList was introduced in .NET 4.5, for a moment I thought the missing part of the puzzle was finally inserted in place: a way to pass a true readonly indexable interface where previously I would have to use my own read-only interfaces…
I've read a lot of questions here about how to read data from serial ports using the .NET SerialPort class but none of the recommended approaches have proven completely efficient for me.
Here is the code I am using for now:
SerialPort port = new…
In this answer https://stackoverflow.com/a/8649429/1497 Eric Lippert says that "FYI we are highly likely to fix this in the next version of C#; this is a major pain point for developers" with regards to how the foreach loops uses the variable.
In…
since working with Visual Studio 2012 RC we get an HttpCompileException when using a class out of an portable class library (.net 4.5 & metro profile) within a razor view.
Exception: (german to english translated on google,…
I am trying to find ways to log method name in an efficient manner w.r.t. speed and maintainability. I guess, In .NET 4.5 Caller Information attributes are exposed just for this purpose except the speed part. I feel these are just syntactic sugars…
I am using async/await pattern in .NET 4.5 to implement some service methods in WCF.
Example service:
Contract:
[ServiceContract(Namespace = "http://async.test/")]
public interface IAsyncTest
{
Task…
I am using .Net4.5 and C#, I am working on one of database migrations using FluentMigrator. I am able to alter tables and add columns by using
Alter.Table("Items").InSchema("Pricing")
…
Everything was working today until it stopped... Below is the minimum source code (I'm using VS 2012 Update 1, .Net 4.5). When I run it, app exits upon calling client.PostAsync() and so it never reaches Console.ReadLine(). Same in debugger, no…
I am trying to update the status strip in my Windows Forms application, but nothing is being displayed. Here is my code:
private void textBox1_TextChanged(object sender, EventArgs e)
{
lines = Regex.Split(textBox1.Text.Trim(), "\r\n");
…