1

I've created a new Web Application Project in VS2015 using the newer aspnet5 templates. However I can't seem to find a straight answer on how to specifically target the .NET 4.6.1 Framework with it. Looking at the pictures below can someone please shed some light on how to use the newer prject structures but target the .NET Framework 4.6.1 with them. According to microsoft this is possible but I can't make heads or tails on specifically how to do this.

The old and new ways are shown below. The new way below shows use specific runtime... enter image description here

With the following showing in the references enter image description here

The old way seemed much more straight forward. Showing a specifically targeted framework.

enter image description here

The same problem exist for Class Library projects where it seems to want to target an SDK vs a particular version of the framework. enter image description here

enter image description here

DRobertE
  • 3,478
  • 3
  • 26
  • 43
  • This is closely related to http://stackoverflow.com/questions/34817523/asp-net-5-project-not-properly-targeting-net-4-6-1-and-cannot-be-debugged – Josh Schultz Feb 01 '16 at 19:55

1 Answers1

0

I believe you need to set your DNX_IIS_RUNTIME_FRAMEWORK environment variable to "DNX461". I found this question relevant.

Community
  • 1
  • 1
Chase
  • 934
  • 6
  • 18
  • From what I've read DNX for framework identification is going away. After reading these two articles http://www.hanselman.com/blog/ASPNET5IsDeadIntroducingASPNETCore10AndNETCore10.aspx and https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/standard-platform.md – DRobertE Jan 20 '16 at 21:09
  • I tried this just for kicks and it didn't work... I set the project.json to dnx46 and that worked without the use of the environment variable. But is Running on DNX46 the same as saying it's running on The .Net Framework 4.6 and not .NET Core v1.0 – DRobertE Jan 21 '16 at 14:21
  • If you want to brute force it, you can edit your project's `.csproj` file with a text editor, locate the `` tag and set it manually there. Not an elegant solution, though... – Chase Jan 21 '16 at 18:09