2

I've been reading about some of the new features in ASP.NET 4.5, but I'm not sure how to get access to it.

Google doesn't seem to turn up anything.

This link indicates to me I'm still using ASP.NET 4.0.30319.34014 (System.Environment.Version).

Wikipedia suggests it's parallel (loosely?) to .NET 4.5 (Which I'm currently targeting), but that doesn't seem to be what System.Environment.Version is returning.

Right now I'm running MVC 5.2.3 on Visual Studio 2013 Update 4.

I don't see ASP.NET explicitly referenced in my NuGet package manager:

Microsoft.AspNet.Mvc           4.0.40804.0          
Microsoft.AspNet.Mvc           5.2.3                
Microsoft.AspNet.Razor         3.2.3                
Microsoft.AspNet.Web.Optimi... 1.0.0        
Microsoft.AspNet.WebApi        5.0.0                
Microsoft.AspNet.WebApi.Core   5.0.0                
Microsoft.AspNet.WebPages      3.2.3  
Microsoft.AspNet.WebPages.Data 3.2.3                
Microsoft.AspNet.WebPages.O... 2.0.30506.0          
Microsoft.AspNet.WebPages.W... 3.2.3       
Community
  • 1
  • 1
micahhoover
  • 2,101
  • 8
  • 33
  • 53
  • 2
    Your .NET framework version and the versions of your NuGet packages have nothing to do with each other. First, is the .NET framework 4.5 installed on your machine ? Have you set your project to the right .NET framework version (Project Properties) ? That should be it (if I do understand your question correctly). – Maxime Sep 10 '15 at 18:34
  • @Maxime: Sounds like the version of ASP.NET is tightly coupled to the version of the .NET framework -which is fine, but I didn't see that mentioned anywhere. The .NET framework is installed on my machine (since I'm on Windows 8.1) and my VS project is targeting .NET 4.5. Sounds like System.Environment.Version is misleading ... – micahhoover Sep 10 '15 at 18:42
  • 1
    Yes, it's misleading. Let me write a complete answer. – Maxime Sep 10 '15 at 18:43

1 Answers1

3

First, it is important to note that your .NET framework version and the versions of your NuGet packages have nothing to do with each other.

Second, make sure the .NET 4.5 framework is installed on your machine. See the Installing the .NET Framework page.

Then, make sure you set your project to target the right version. To validate, right click on your project the click on Properties and check in the Application tab for Target framework.

Once it's done, you now have to understand how to correctly read your .NET framework version. After .NET 4.0, the version number is misleading. I suggest you check this answer.

To answer you directly, version 4.0.30319.34014 is .NET 4.5.1 on Windows 8.1 64-bit.

Basically, you have nothing to do and you're done! :-)

Community
  • 1
  • 1
Maxime
  • 8,645
  • 5
  • 50
  • 53