Announcing the release of .NET Framework 4.5 RTM - Product and Source Code

Announcing the release of .NET Framework 4.5 RTM - Product and Source Code

Rate This
  • Comments 50

Updated – 8/16/2012: Added license information about the source code release.

Today, we are happy to announce the availability of Microsoft .NET Framework 4.5 and Visual Studio 2012. You can develop apps that will take advantage of all the great features that we have added, including new features in Windows 8. We are also announcing the availability of the .NET Framework 4.5 reference source code, under the Microsoft Reference Source License (MS-RSL).

You can read more about the Visual Studio 2012 release on Jason Zander’s blog and Soma’s blog. Please visit the Visual Studio 2012 downloads page to install both products.

Improvements in the .NET Framework 4.5

We have made many improvements in the .NET Framework 4.5. Many of these advances help you write better apps with less effort, while others help you target particular Microsoft platforms. In either case, you’ll find the new features useful and relevant for the apps that you write today.

  • Core runtime and class library improvements
    The most important core advance is the new async programming model, which has broad support across the common language runtime (CLR), the .NET Framework base class libraries, and the C#, Visual Basic, and F# languages. In particular, we added hundreds of new Task-returning methods across the .NET Framework libraries.

    We made performance improvements in many parts of the core. Given the focus on async, we made the Task Parallel Library (TPL) and other concurrency APIs faster. We also made across-the-board improvements in the CLR, including multicore JIT, MPGO, and big wins in CLR garbage collection. If you are building responsive or scalable systems, or would like to take advantage of multicore and manycore processors, you'll find this a very exciting release.

    Visual Studio 2012 has built-in support for creating portable class libraries, which make it easier to re-use your code across apps built for different platforms.

  • Windows Store app programming experience for C# and Visual Basic
    The .NET Framework 4.5 enables you to create Windows Store apps using C# and Visual Basic. These include both XAML and HTML Apps. This support is based on the work that we did to allow Windows Runtime APIs to be called from managed code. It also includes the new .NET for Windows Store apps API surface area.

    You can call Windows Runtime APIs with C# and Visual Basic, and you can also create Windows Runtime APIs with those same languages. This ability is very useful if you want to call managed code within an HTML App or a C++ XAML or DirectX app. As part of this scenario, you can call Windows Communication Foundation (WCF) services from within your Windows Runtime API implementation.

    We made performance improvements specifically for Windows Store apps. We reduced startup time substantially, updated the garbage collector to aggressively reclaim memory upon app suspension, and created a service to automatically generate native images for your app DLLs. We also improved file I/O performance when using the .NET Framework stream extension methods, which automatically buffer underlying Windows Runtime streams.

  • ASP.NET
    ASP.NET followed the trend of excellent support for async, including async in ASP.NET Web Forms, ASP.NET MVC, and ASP.NET Web API.

    ASP.NET 4.5 and Windows 8 added support for the Web Sockets API. The upcoming ASP.NET SignalR provides developers with an ideal high-level abstraction that enables real-time communication not just over Web Sockets, but also transport fallback for older browsers.

    ASP.NET Web Forms 4.5 gets a huge upgrade with support not only for strongly typed data controls in all data-bound controls, but also Model Binding, which will greatly simply your Web Forms code-behind files. Web Forms developers can even use ASP.NET Data Controls with the repository pattern. ASP.NET Web Forms also has complete support for HTML5 and CSS3, and takes advantage of the new editor improvements in Visual Studio 2012.

  • Windows Communication Foundation (WCF)
    We made many improvements in WCF, including: better performance, reliability and scale with WebSockets, and support for client-side validation of the server SSL certificate using WCF’s custom X509 certificate validator on a per-request basis.

  • Entity Framework
    Entity Framework now supports enum properties and spatial data types in models created with Code First and the EF Designer. Models created with the EF Designer can now map to Table-Valued Functions (TVFs) in an existing database. We also made significant performance improvements to Entity Framework.

  • Windows Workflow (WF)
    Windows Workflow now includes key authoring improvements, new versioning features, and runtime enhancements. You can now host workflow definitions and instances, with side-by-side versioning, in WorkflowServiceHost. The new Dynamic Update feature allows running workflow instances to be modified.  Expression extensibility gives you more flexibility in providing custom expression authoring experiences.

Releasing the source code for the .NET Framework 4.5 libraries

In addition to releasing the .NET Framework 4.5, we are pleased to announce that we are also releasing the source code for the .NET Framework libraries. We are releasing the source under the Microsoft Reference Source License (MS-RSL). While you may enjoy reading the many interesting algorithms in our product, we release the .NET Framework source primarily to improve your debugging experience. Having access to all the managed source for the code running in your process provides you with a lot more information about what your app is actually doing.

If you are new to developing with the .NET Framework, you may not know that we have released the source and rich symbols in past versions. We know that many developers rely on our source code to efficiently get to the root cause of functional and performance problems in their apps. As a result, we provide the source code concurrently with the release of .NET Framework 4.5.

This release includes the following:

  • Downloadable source code
  • Source available on-demand, deployed to the Microsoft Reference Source Server
  • Rich symbols (PDB files) for .NET Framework 4.5 source, deployed to the Microsoft Reference Source Server

We’ll now look at how you can use the source code and symbols.

Debugging with .NET Framework library reference source

You may be wondering what debugging with .NET Framework reference source looks like. In the example below, you will see a tool of mine calling the public Console.WriteLine method. From there, the WriteLine method calls several private managed APIs, and eventually ends with one or more platform invoke calls. You can see each of these calls in the Call Stack window. You can look at each call frame, both in terms of the source for that frame, and any locals that are available. That’s pretty useful!

Example of debugging into the .NET Framework reference source code

This experience works for 32-bit and 64-bit apps on x86 and x64 machines, as appropriate. It also works when running on either an x86 or x64 machine, while remote debugging an app that is running on an ARM tablet. I can imagine that you might be looking forward to giving that last scenario a try.

This experience also works for all .NET Framework app types, including ASP.NET, WPF, Windows Forms, console, and Windows Store apps. We call this experience of seeing .NET Framework library source in Visual Studio, “.NET Framework source stepping.” As you might guess, you can step in and out of .NET Framework code, using all of the stepping commands that you are used to, such as F11, F10, and Shift+F11. It's pretty easy to set this up. I'll explain how.

Enabling .NET Framework source stepping in Visual Studio 2012

We’ll first start with the instructions for enabling source and symbols download on demand. This mode works the best if you have consistent Internet access. You need to make a few configuration changes in Visual Studio 2012.

First, open the Options dialog box by choosing Options and Settings… from the Visual Studio Debug menu, expand the Debugging node, and then choose the General option. Set the following:

  • Clear the Enable Just My Code checkbox.
  • Check Enable .NET Framework source stepping.
  • Clear Step over properties and operators (Managed only)
  • Check Enable source server support.
  • Clear Require source files to exactly match the original version.

Settings to enable debugging into the .NET Framework reference source

Next, set the following on the Symbols page which is also under the Debugging node:

Settings to get online debugging symbols for the .NET Framework

You can now choose OK, and start using .NET Framework source stepping as part of your development process.

Enabling offline source in Visual Studio 2012

There are times when you don’t have a connection to the Internet, for example, when you're traveling. Also, some people prefer to pay the download cost just once, and then not think about it again. We’ve got both of those cases covered.

You can download the source and symbols for the .NET Framework 4.5 as an MSI installer. Once you've installed them to a particular location on your local disk or network, you need to provide a symbol file location that's different from what we've specified in the previous section. I’ve provided an example below.

Settings to get offline debugging symbols for the .NET Framework

Once you have the offline reference source package installed and configured (as shown above) in Visual Studio 2012, you are ready to start stepping into .NET Framework library source.

Implications for multi-targeting

You can use the .NET Framework multi-targeting features and the reference source together; however, it is important to know how these relate to each other. The reference source is tied to the runtime version that you run your project on, not the version of the .NET Framework that you are targeting. For example, even if your project targets the .NET Framework 4, you will be using the .NET Framework 4.5 reference source when debugging in Visual Studio 2012.

Closing

We hope that you are as excited as we are about the release of the .NET Framework 4.5 and the reference source. We’ve built many new features that will make you more productive targeting all of the Microsoft platforms. You can download the .NET Framework 4.5 and Visual Studio 2012 from the Visual Studio downloads page.

You can learn more about reference source at the Microsoft Reference Source Code Center.

As always, we would like to hear from you. Please don’t hesitate to post a comment on the blog or at one of the forums that we monitor: Connect (report bugs), UserVoice (request features), and MSDN Forums (ask for help).

Leave a Comment
  • Please add 5 and 4 and type the answer here:
  • Post
  • @Keith P We are aware of this issue and are working to fix this.  We are also tracking this as a User Voice request.

    visualstudio.uservoice.com/.../4083118-allow-developers-to-step-through-net-framework-so

    We will update the status of this work there.

    thanks

    -alok

    Program Manager

    .NET Framework

  • I was interested in yet another claim referring to the ability to step through .NET code. I did a quick straw poll of various developers I know in various companies and none of the ones who have tried have ever got .NET source code debugging to work with any combination of OS version, VS version and .NET version. None, ever. There are many posts including a Connect bug connect.microsoft.com/.../net-framework-4-reference-sources-fail-since-out-of-date echoing this.

    I did try myself again, hoping in vain it might work, and found the following. I picked PresentationFramework.dll fairly at random. Note the debugging failed when I used the referencesource.microsoft.com/symbols server so I downloaded the relevant components from the reference source site to see what GUID versions of PDB file were in them. Anyway here is the data

    Windows 7 with .NET 4.5

    File location C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll

    Version 4.0.30319.18054  - I suspect this version was installed via Windows Update support.microsoft.com/.../2840642

    Version 4.0.30319.18054

    GUID contained in my installed DLL

    7650C3B3BF894ED8BE08178487AC23C71

    PDB GUIDs available in downloadable 4.5 reference source

    133AC10A552F4A9D87FD17245F81B5821

    967EB32CF0BE498BA1E15280FE3C6DB11

    D8F0CD1E8A0346F6B3F191638D9022F01

    So it's fairly clear that the GUID of the DLL's installed on my boxes, which are fairly standard and kept up to date via Windows update, don't match the GUILD's of the PDB that are available. This seem to always be the case. I suspect there may be the odd occasion when they match once in a blue moon but even if it did work for a while it would stop when a windows update updated a DLL.

    The fundamental problem seem to be that Microsoft don't seem to keep the reference source PDB in sync with the DLL that Window Update installs. As soon as a DLL is replaced via Windows Update with one with a new GUID a matching PDB file with the same GUID needs be added to the reference source site.

    My view is that the reference source site is updated via a completely separate process to the Windows Update process and is never in sync, hence it never works. In my opinion Microsoft either needs to incorporate updates to the reference source site into the process used to build and release DLL's via Windows Update or it should stop claiming that you can step through .NET code using this mechanism. Claiming a feature works when it doesn't only leads people to have a negative view of MS and wastes a lot of time trying to get the feature to work.

    Anyway on the positive side kudos for releasing the source code it very useful to be able to read it. Even if I can't be sure it's actually what I'm running in my DLL's it's normally close enough to help enormously.

  • can 4.5 be used in the express edition of vb.net.    jogbuehi@yahoo.com

  • @jude

    The "VB Express 2010" is pretty old by now. You should have upgraded to one of the newer Express editions:

    www.visualstudio.com/.../download-visual-studio-vs.aspx

    .Net4.5 works great with VB in these newer Express editions. (Also you'll be able to use the great new VB features that you'll find in these newer Express editions... async/await for more responsive UIs, the CallHierarchy window, and a few other fixes).

  • So, when will stepping through source code work?

    stackoverflow.com/.../debug-net-framework-source-code-in-visual-studio-2012

    stackoverflow.com/.../visual-studio-2012-cannot-step-into-ms-source-code-for-system-data-linq-datacont

    and countless others..

Page 4 of 4 (50 items) 1234