ASP.NET CORE 1.0: Multiple Frameworks Target Issues

The Core ASP.NET had several changes after being updated from RC1 to RC2 version. Now, after creating a new ASP.NET Core Web Application (.NET Core) , only the .NET CORE (netcoreapp1.0) is added by default. core

 

To add full .NET Framework into the project, you must include a reference to it, through the project.json configuration file, as:

“frameworks”: {
“netcoreapp1.0″: {
“imports”: [
“dotnet5.6″,
“dnxcore50″,
“portable-net45+win8″
],
“dependencies”: {
“Microsoft.NETCore.App”: {
“version”: “1.0.0-rc2-3002702″,
“type”: “platform”
}
}
} ,
    “net461″: { }
},

However, after saving the changes, the following error will be generated:

error NU1002: The dependency System.Runtime.Loader 4.0.0-rc2-24027 does not support framework .NETFramework,Version=v4.6.1.

 

erro

 

This error occurs because the dependence Microsoft.NETCore.App is not compatible with FULL version of the .NET Framework. To eliminate the error, you must open the project.json file and move the Microsoft.NETCore.App dependency out of “dependencies”: dep

 

Into a new “dependencies” section under the “netcoreapp1.0” key in “frameworks”, as:

“frameworks”: {
“netcoreapp1.0″: {
“imports”: [
“dotnet5.6″,
“dnxcore50″,
“portable-net45+win8 “],
      “dependencies”: {
        “Microsoft.NETCore.App”: {
          “version”: “1.0.0-rc2-3002702″,
          “type”: “platform”
        }
}
},
“net461″: { }
},

 

I hope have helped.