A first hand look from the .NET engineering teams
Updated (July 2015): See Announcing .NET Framework 4.6 to read about the latest version of the NET Framework.
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.
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.
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:
We’ll now look at how you can use the source code and symbols.
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!
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.
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:
Next, set the following on the Symbols page which is also under the Debugging node:
You can now choose OK, and start using .NET Framework source stepping as part of your development process.
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.
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.
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.
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).
We too are very interested in your response to the issue Stephen brings up as we are in the same situation of having to support deployments with a large number of machines that .NET 4.5 does not support. This limits our options going forward.
Similar to Stephen, we have had to instruct both our developers and our clients to not install anything that would include .NET 4.5 (including VS2012) until a resolution on this is reached.
Great post indeed. I really like that you are providing information on .NET for freshers , Being enrolled at www.wiziq.com/.../57-fresher-training-projects i found your information very helpful indeed. Thanks for it.
It has been more than a month since I last posted here and you said you were still working on a compatability post.
Are you still working on it? (It has been almost 2 months since you said you would post something.)
If it is going to be months more in the waiting, can you just re-open dialog here with me about what constitutes a "breaking bug fix". Maybe start by responding to my question I asked out a few posts ago? (The one with the example that seemed breaking to me but you did not confirm if it was for your definition.)
@Stephen, thank you for keeping the dialog alive. To your question, yes we are working on pulling together more insights into our compatibility work. I know your eagerly awaiting what we have to say, so I want to thank you for your patience. You shouldn't have much longer to wait.
Great job with .Net and Visual Studio!! Hats off to your amazing work!
By the way, I can't get the source code for .NET 4.5 -- I press the 'Download' link on the table in the rightmost column of the 'NET' '4.5' row and then it stalls for more than 30 seconds before it finally downloads a .ASPX file which is just the webpage from which I downloaded it (I checked, it has the exact markup of referencesource.microsoft.com/netframework.aspx).
Anyway, kudos for what you're doing! Keep it up!!
>> By the way, I can't get the source code for .NET 4.5 -- I press the 'Download' link on the table in
>> the rightmost column of the 'NET' '4.5' row and then it stalls for more than 30 seconds before it
>> finally downloads a .ASPX file which is just the webpage from which I downloaded it (I checked,
>> it has the exact markup of referencesource.microsoft.com/netframework.aspx).
Could anyone by any chance help me with this? Much appreciated!
Thank you for getting the post on Compatibility out there.
However, it did not address what we were discussing.
The only safe changes (not additions) are things that are "Quirked". And (as far as I have seen) fixes in .NET 4.5 to .NET 4.0 bugs were not done under a "Quirk".
As far as I can see, every bug fix IS a breaking change. You indicated that they are not, but I cannot see how this is possible.
If this is not correct, then I would love to know why. I am still hoping for some way to convince my boss that we can upgrade to .NET 4.5 and not have it be an "All At Once" upgrade.
Where are the symbols for ASP.NET MVC please? Symbol server does not have them...
You can get the MVC symbols at: www.symbolsource.org/.../Microsoft.AspNet.Mvc
And we are back to ignoring me. Sigh...
@Stephen, please send a message via the contact form (located at the top right of the blog). I'd much prefer discussing your concerns over a phone call with you rather than back and forth in comments on a blog. Then I can arrange a time for the conversation and pull in someone from the compatibility team.
@Brandon - we'd prefer to see your discussion with Stephen in public. We are facing the same issues.
@Allan, I don't mind following up in the comments with notes from the discussion. What I don't want to continue is the back-and-forth dialog the consists of, "that's not what I'm talking about." I'm happy to extend the same offer to you to have a phone conversation -- just reach out to us via the contact form in the top right.
There are lots of people out there who are interested in this issue. So I guess a short posting here would do best.
I mean, yes, I could call you too, even though I'm in Europe. But do you really prefer telling x people (where x~30) the same thing on the phone?
Stephen's 4th posting (the one referring to connect.microsoft.com/.../wpf-unable-to-add-items-to-an-empty-grouped-and-sorted-collectionview ) contains 2 simple questions. An answer to those would help us very much.
I've tried the steps listed here, as I need to debug a WebForms issue (using VS2012 with .Net 4.5). However, System.Web.dll symbols do not load, so I cannot see source for it. Is this intentional? I've downloaded the local installer, and VS will load source for System.dll et al (and the correct version 4.0.30319.18034), but will not load the same for System.Web.dll (same version). Manually pointing it to the RefSrc/Symbols path for the assembly, and it says that the PDBs don't match. VERY frustrating (which has unfortunately been my experience with the reference source stepping feature since Day 1)