tagged [.net-4.6]

How to deal with Code Contracts warning CC1036 when using string.IsNullOrWhiteSpace?

How to deal with Code Contracts warning CC1036 when using string.IsNullOrWhiteSpace? I have the following code contract: When compiling, I get the following warning: > warning CC1036: Detected call to...

22 Jan at 10:2

Visual Studio 2015 - Shared Projects Reference Tab Missing on Web Project

Visual Studio 2015 - Shared Projects Reference Tab Missing on Web Project I upgraded to Visual Studio 2015 from our MSDN subscription because I was pretty excited to read about Shared Projects... No m...

This application requires one of the following versions of .NET Framework

This application requires one of the following versions of .NET Framework I am trying to migrate our application to the newer version of .NET Framework. From current version of 4.5 to 4.6.1 Reason, wh...

Mixed WPF and winforms project DPI awareness

Mixed WPF and winforms project DPI awareness I have a C# program that uses both winforms and WPF and I'm struggling to get it to work in high DPI environments. Currently, if I remove all WPF projects ...

1 Aug at 17:44

RyuJit producing incorrect results

RyuJit producing incorrect results After recently upgrading to .net 4.6 we discovered a bug where RyuJit produces incorrect results, we were able to work around the issue for now by adding useLegacyJi...

22 Jul at 17:53

Is there any benefit of using the nameof operator instead of the CallerMemberNameAttribute to notify property changes in .NET 4.5.3?

Is there any benefit of using the nameof operator instead of the CallerMemberNameAttribute to notify property changes in .NET 4.5.3? With the advent of .NET 4.5.3, WPF developers now have three (or mo...

TaskContinuationOptions.RunContinuationsAsynchronously and Stack Dives

TaskContinuationOptions.RunContinuationsAsynchronously and Stack Dives In [this blog post](https://devblogs.microsoft.com/pfxteam/new-task-apis-in-net-4-6/), Stephan Toub describes a new feature that ...

Visual Studio 2015 InvalidProgramException in Unit Test With Fakes

Visual Studio 2015 InvalidProgramException in Unit Test With Fakes I am using Visual Studio 2015 Enterprise RTM to write unit tests for a project that uses [Unity Container](https://github.com/unityco...

Always use the 'async' and 'await' keywords in asynchronous methods in a library?

Always use the 'async' and 'await' keywords in asynchronous methods in a library? : In a library method, when should I use the `async` and `await` keywords instead of returning a `Task` directly? I be...

How does ServicePointManager.ReusePort and SO_REUSE_UNICASTPORT alleviate ephemeral port exhaustion?

How does ServicePointManager.ReusePort and SO_REUSE_UNICASTPORT alleviate ephemeral port exhaustion? Windows 10 and Windows Server 2016 introduced the `SO_REUSE_UNICASTPORT` socket option. It was made...

Does C# store arrays larger than 512 longs (4096 bytes) differently?

Does C# store arrays larger than 512 longs (4096 bytes) differently? I did some benchmarks with collection types implemented in the .NET Framework. From the Reference Source I know that `List` uses an...

1 Jul at 08:23

.Net 4.6 breaks XOR cipher pattern?

.Net 4.6 breaks XOR cipher pattern? In .NET 4.5 this cipher worked perfectly on 32 and 64 bit architecture. Switching the project to .NET 4.6 breaks this cipher completely in 64-bit, and in 32-bit the...

31 Jul at 19:14

MSBuild restore target - MSB4057: The target "restore" does not exist in the project

MSBuild restore target - MSB4057: The target "restore" does not exist in the project We have over 20 solutions in our main product portfolio (over 880 projects), and we have a complex set of build scr...

Expressions breaking code when compiled using VS2015 Update 1

Expressions breaking code when compiled using VS2015 Update 1 After installing Visual Studio 2015 Update 1 on my machine I saw that some of my unit tests failed. After doing some investigation I was a...

Is this closure combination behaviour a C# compiler bug?

Is this closure combination behaviour a C# compiler bug? I was investigating some strange object lifetime issues, and came across this very puzzling behaviour of the C# compiler: Consider the followin...

23 May at 11:45

Why do optional parameters get passed wrong values in Visual Studio 2015?

Why do optional parameters get passed wrong values in Visual Studio 2015? I found a weird behavior in VS2015 Here are the details: I have a .Net 4.6 project referencing a 3.5 assembly. This assembly d...

Put GC on hold during a section of code

Put GC on hold during a section of code Is there a way to put the GC on hold completely for a section of code? The only thing I've found in other similar questions is `GC.TryStartNoGCRegion` but it is...

24 May at 21:8

Garbage Collection and Parallel.ForEach Issue After VS2015 Upgrade

Garbage Collection and Parallel.ForEach Issue After VS2015 Upgrade I have some code to process several million data rows in my own R-like C# DataFrame class. There's a number of Parallel.ForEach calls...

How to fix No connection could be made because the target machine actively refused it 127.0.0.1:64527

How to fix No connection could be made because the target machine actively refused it 127.0.0.1:64527 I have an MVC application which depends on a web API application, I hosted the two on a shared hos...

WCF SslStreamSecurity DNS Identity Check failing for just 4.6 framework

WCF SslStreamSecurity DNS Identity Check failing for just 4.6 framework I am working on developing a new binding for a Wcf service that is hosted in IIS, I thought I got everything working, but it tur...

21 Jan at 01:4

Stream.CopyToAsync with progress reporting - progress is reported even after copying finish

Stream.CopyToAsync with progress reporting - progress is reported even after copying finish I've build a simple console applications that download files from the internet. Because [I had problems with...