Questions tagged [.net-4.6]

.NET 4.6 (previously called .NET 4.5.3) is the latest framework release from Microsoft. It is a followup to .NET-4.5.2 which brings new features to both infrastructure (Roslyn, the compiler as a service) and new language features for both VB.net and C#

The .NET Framework 4.6 is the next version of the .NET Framework. Up until now we have been using .NET Framework 4.5.3, however since the payload includes significant features and improvements, the release number was bumped up the to clearly communicate the magnitude of changes. Note that in the Preview release, you’ll still see instances of “4.5.3” in the .NET Framework and Visual Studio version information. These will be updating these in future releases.

There are many great features in the .NET Framework 4.6 Preview. These range from new WPF features to RyuJIT as well as productivity enhancements in Visual Studio:

.NET Language Innovation

In this release, several new C# and Visual Basic language features help reduce boilerplate and clutter in everyday code, encourage a more declarative style of programming, and bring the two languages even closer together. The features listed below will be available to both languages in the final release. A few highlights are shared below. Checkout the C# and VB Team blogs for all the details.

  • Methods, getter-only properties etc. can now have a single expression as their body, just like lambdas.
  • Nameof provides a refactoring-safe way of getting the name of e.g. a parameter, member or type as a string.
  • Auto-properties can have initializers and no longer require setters.
  • Index initializers Inside an object initializer you can now initialize a specific index of the new object. C# only.
  • Exception filters let you look at an exception and decide whether to catch it with a given catch block.
  • Using null-conditional operators you can get a built-in null check while accessing and invoking members and indexers.
  • Using clauses for static classes bring their static members directly into scope, so you can. call e.g WriteLine() or Sqrt() without prefixing with the class name.
  • Await now works in catch and finally blocks, obviating some very tricky workarounds.
  • String interpolation: String interpolation provides a concise way of describing string templates that insert expressions into format strings (C# only at Preview, both VB and C# at RTM).

WPF Improvements and Roadmap

WPF has key improvements in this release:

  • Transparent child windows
  • Multi-image cursor files
  • Re-designed Blend experience
  • New set of Visual Diagnostics tools
  • Timeline tool in the Performance and Diagnostics hub

Windows Forms High DPI

Windows Forms High DPI support has been updated to include more controls. The .NET Framework 4.5.2 included high DPI support an initial set of controls.

This feature has been expanded to include: DataGridView, ComboBox, ToolStripComboBox, ToolStripMenuItem, Cursor, DomainUpDown, NumericUpDown, DataGridViewComboBoxColumn, DataGridViewColumn and ToolStripSplitButton types.

This is an opt-in feature. To enable it, set the EnableWindowsFormsHighDpiAutoResizing element to true in the application configuration (app.config) file:

<appSettings>
   <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>

Next Generation JIT Compiler -- RyuJIT

This release includes a new version of RyuJIT, the 64-bit JIT Compiler. It is enabled by default for 64-bit processes.

  • Correctness – We’ve been focusing on fixing correctness bugs, using various Microsoft cloud workloads to validate RyuJIT. This approach has been working well, since the Microsoft cloud is a very heavy user of .NET.
  • Real-World Throughput – The Bing team recently started using RyuJIT on some of their search-related workloads. Based on their initial experiments, they have seen a 25% improvement in startup time, which is a significant win.
  • SIMD Improvements – We created the SIMD .NET library in unison with RyuJIT so that RyuJIT could optimize the SIMD types. Lately, we’ve been tuning our use of registers in the RyuJIT SIMD optimizations. CPUs can crunch numbers much faster in registers, since they are effectively memory on the CPU.

While the attempt to transition to the new JIT compiler as transparent as possible, there still may be compatibility issues. If your application produces an undesired behavior on RyuJIT, you can try disabling RyuJIT, which switches your application back to using the previous JIT to determine if the problems you are seeing are caused by RyuJIT.


CLR Performance Improvements

The assembly loader now uses memory more efficiency by unloading IL assemblies after a corresponding NGEN image is loaded. This change is a major benefit for virtual memory for large 32-bit apps (such as Visual Studio) and also saves physical memory.


Support for converting DateTime to or from Unix time

New methods have been added to support converting DateTime to or from Unix time. This can be necessary, for example, when converting time values between a JavaScript client and .NET server. The following APIs have been added to DateTimeOffset.

static DateTimeOffset FromUnixTimeSeconds(long seconds)
static DateTimeOffset FromUnixTimeMilliseconds(long milliseconds)
long ToUnixTimeSeconds()
long ToUnixTimeMilliseconds()

ASP.NET Model Binding supports Task returning methods

ASP.NET Model Binding methods that were previously returning Task were not supported and threw an exception at runtime. With .NET Framework 4.6, if applications are deployed with such methods, these methods will now be executed correctly.0


Channel support for managed EventSource instrumentation

You now can use .NET EventSource instrumentation to log significant administrative or operational messages to the event log, in addition to any existing ETW sessions created on the machine

438 questions
0
votes
0 answers

VSO Hosted Build Controller: Support for .NET 4.6 & Azure SDK 2.7?

The Visual Studio Online Hosted Build Controller does not seem to support .NET 4.6 or the Azure SDK 2.7 yet. Is there any idea as to when these will be supported?
Dave New
  • 38,496
  • 59
  • 215
  • 394
0
votes
1 answer

Merge 2 collections and change a property of same objects

I have 2 collections of customers: all customers list related customer list All customers list has all the customers. Related customers list contains some customers from the "all customers list" I want to return a 3rd collection called…
Pascal
  • 12,265
  • 25
  • 103
  • 195
-1
votes
1 answer

Nanoseconds to DateTimeOffset

I am using .Net version 4.6 and I am using DateTimeOffset.FromUnixTimeMilliseconds to convert nanoseconds to DateTimeOffset. long j = 1580122686878258600; var X = DateTimeOffset.FromUnixTimeMilliseconds(Convert.ToInt64(j * 0.000001)); I am storing…
user584018
  • 10,186
  • 15
  • 74
  • 160
-1
votes
1 answer

what in a local PC setting can change a HttpWebRequest ServicePoint.Address?

What on local PC can affect ServicePoint.Address of the HttpWebRequest? After I create a HTTP request by providing a URI: HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); request.ServicePoint.Address having a different value.
GenZiy
  • 1,427
  • 2
  • 15
  • 20
-1
votes
1 answer

Unicode Power Symbols in XAML

As announced on this site there are new Power symbols in Unicode 9.0 available and I tried to include one symbol to my XAML code e.g.
leon22
  • 5,280
  • 19
  • 62
  • 100
-1
votes
2 answers

Add values to array using "template"

I'm not sure if the title is describing exactly what I want to achieve. Simply put: If I have 6 inputs: Input1: String1 Input2: String1Count Input3: String2 Input4: String2Count Input5: String3 Input6: String3Count I want to…
Ivan Aramazov
  • 167
  • 1
  • 4
  • 12
-1
votes
2 answers

Is it possible to host a chatbot web app made from .net botframework on Linux/Apache?

I have a chat bot made from .NET and Microsoft Bot Framework. Currently it is hosted on Azure as a web app. Is there a way to host it on a Linux/Apache server as well?
yfan183
  • 547
  • 2
  • 7
  • 20
-1
votes
1 answer

Unable to publish project in release mode in Visual studio VS 2013 professional?

I am unable to publish my project in release mode in Visual Studio 2013 professional. I have recently changed the .net framework of the project to 4.6 from 4.5 and to simulate the dev environment with Test and production environment, i have…
-1
votes
1 answer

Auto upgrading .NET framework

My distributed App is using .NET 4.6 features. It's not installed via ClickOnce, but installed manually, for certain reasons. How can I check if installed .NET is lower version and update it before running app. My users are not advanced people and I…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
-1
votes
1 answer

How to serialize List>?

Framework is c# .net 4.6.2 I am generating automatic XML classes from XML codes When I auto generate, it automatically converts as Array[][] But i want to use it as List> And i am sure that my conversation from Array to List causes some…
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
-1
votes
1 answer

How to deploy an asp.net mvc application to IIS

I have build a web application based on asp.net mvc using Visual Studio 2015 and .NET framework 4.6.1. The application have multiple projects. The app is running successfully when I am running from Visual Studio but when I am publishing the app…
Shax
  • 4,207
  • 10
  • 46
  • 62
-1
votes
1 answer

Visual studio 2012 gives me error "The C# project is targeting ,net framework, Version=v4.6, which is not installed on this machine"

I had a .net 4.6 project and I installed the .Net Framework 4.6 but when I open my project Visual studio 2012 gives me those 3 options 1-Change the target to .Net Framework 4.6. You can change back to ".Net Framework, Version=v4.6" at later time.…
-2
votes
1 answer

ActionLink with httpPost on same controller in asp.net MVC 5

I have a login form with "forgot password" link. On login submit I am calling some other action while on "forgot password" link I am calling some different action: @Html.ActionLink("Forgot Password", "ForgotPassword", "Login", Model , new {…
Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
-2
votes
1 answer

await async code seems to still be running sync

I'm new to async / await, and have been trying to implement it in my 4.6 web api 2 project. public class MyController : ApiController { public async Task Search(String searchTerms) { myThing = new Thing(); myThing.FirstProperty =…
Eric
  • 2,273
  • 2
  • 29
  • 44
-2
votes
1 answer

My WPF app still require .NET 4.6 even after targetting .NET 4.5

i've finished my WPF app that targets PCs that do NOT have access to the internet, i was trying to publish the app so i made these steps : right click on Project -> Publish -> enterd the path -> from a CD-Rom or DVD-Rom -> the application won't…
1 2 3
29
30