0

I can't find this property for the asp.net app. The project properties has just several property and not the targeted framework. I've already spent 1 hour trying to find it... please help. Thanks

mimic
  • 4,897
  • 7
  • 54
  • 93
  • Have a look at your project.json file. It should list targeted frameworks. – mason Mar 27 '15 at 02:48
  • @mason, thanks. This file has " "frameworks": { "aspnet50": { "dependencies": { "proj": "1.0.0-*" } }, "aspnetcore50": { } }," but I don't see the .Net framework version here. – mimic Mar 27 '15 at 03:08
  • Appears aspnet50 is basically .NET 4.5 and aspnetcore50 is .NET 2015. Also see [this Twitter convo](https://mobile.twitter.com/onovotny/status/524381569323384832). – mason Mar 27 '15 at 03:14
  • I've created a test project based on 4.6 and add the reference to proj into it. VS put it in the same place as in my web app project.json but it can be compiled whereas my web app can't. I really don't know what and where I should change. – mimic Mar 27 '15 at 03:27
  • What project type did you create? There's a specific ASP.NET 5 class library to use if you want to to reference it from an ASP.NET 5 web application (the name will likely change in the future) – mason Mar 27 '15 at 03:35
  • If you are asking about the project that references it's asp.net mvc 5 (or "asp.net preview"), referenced project is just class library. – mimic Mar 27 '15 at 03:37
  • Like I said, you can't just reference a plain class library. You must do an ASP.NET 5 Class Library, under the Web node in the new project menu. – mason Mar 27 '15 at 03:39
  • @mason, I really can create a plain class library and I did it. I successfully referenced if from another test asp.net mvc 5 project because this project was initially targeted to .Net 4.6. My web app was targeted to 4.5 that's why reference to class library 4.6 doesn't work. What I'm trying to find is how I can change this targeted version for this app from 4.5 to 4.6 and I can't find - that's the question. – mimic Mar 27 '15 at 03:44
  • http://stackoverflow.com/questions/28034174/why-create-an-asp-net-5-class-library-project – mason Mar 27 '15 at 03:46
  • Okay forget about the referenced project. All I wanted to do is just to change the targeted framework of .Net. How? – mimic Mar 27 '15 at 03:49
  • @mason, if there would be a dropdown I would never ask here. It's the problem - no dropdown, no any mention of the targeted framework. And what to do with project.json, how to edit it is still not clear. – mimic Mar 27 '15 at 03:58
  • Your app is currently targeting two frameworks at the same time. You can change that by modifying the project.json file. Remove a targeted frameworks if you want. It' s just a JSON or text file. By the way, if I need to explain this to you, it's probably a sign that you shouldn't be using VS 2015 and ASP.NET 5. It's pre-release software. Personal research and tinkering are expected. Perhaps you'd be better off with a VS 2013 and a fully supported and not constantly in motion framework until the new one is officially released and supported. – mason Mar 27 '15 at 04:02

1 Answers1

1

ASP.NET 5 apps can build for multiple frameworks at the same time, this is configured in project.json file. Here I'm building for two frameworks:

{
    frameworks: {
        "aspnet50": { },
        "aspnetcore50": { }
    }
}

This builds for aspnet50 (similar to .NET 4.5.2) and aspnetcore50 ( .NET Core 2015).

I can remove one of those lines to only target one framework. The .NET Core Framework is the new modular framework, which is much smaller than the full .NET framework. .NET Core doesn't have everything, for example System.Drawing. If you want to do graphics related stuff in .NET Core, then you'll need to look in NuGet for another package that accomplishes your needs. And a lot of stuff that was included in the full .NET Framework has been broken up into separate packages that are available on NuGet. You can use compiler directives to run different code for different frameworks if you have code that you want to run in one framework but not the other.

For more information about the project.json file and the frameworks configuration, see the wiki.

mason
  • 31,774
  • 10
  • 77
  • 121
  • For example I nee this System.drawing. Which nuget package should I add? there is nothing like that. – mimic Mar 27 '15 at 04:28
  • @Seacat You will have to find one that accomplishes your needs (if one exists already). SO isn't here to find libraries for you. I'm disturbed by the fact that you said you *need* it. ASP.NET 5 isn't production ready. It's there for you to play around with and give feedback, not build sites you intend to use yet. Like I said in my comment on your question, it sounds like ASP.NET 5 isn't for you at the moment - you really need to ask yourself if your application should be on the bleeding edge. Based on what you said, you should stick to VS 2013 and .NET 4.5.2 until ASP.NET 5 is more complete. – mason Mar 27 '15 at 04:36