The documentation for using project.json for ASP.NET 5 applications includes a sample project.json file (abbreviated version below).
What is the difference between frameworkAssemblies
and dependencies
?
And why does dnx451
use one and dnxcore50
use the other?
{
"version": "0.1-alpha-*",
...
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
...
}
},
"dnxcore50": {
"dependencies": {
...
}
}
}
frameworkAssemblies
refers to assemblies present in GAC (global assembly cache).Consider the following example:
I want to use ADO.NET apis(
SqlConnection
,SqlCommand
) to work with a SQL Server database. I know that these apis are part ofSystem.Data.dll
and so want to reference it. Now when the full version of .NET Framework is installed, it installs some assemblies in the GAC (which has thisSystem.Data.dll
too) and hence you see a reference toframeworkassemblies
in the below example. Coming to CoreClr, I need to find out in which package these types exist. For this you could use the website calledPackageSearch
(built by an ASP.NET team member) where you can search for a type and find the package name. Based on this you will findSystem.Data.SqlClient
to be the package. Since this package is built for CoreClr, it is part ofdependencies
section within thednxcore50
section.Now let's say you want to even add support for json serialization and deserialization in your app and want to reference Json.Net nuget package. Json.Net nuget package supports both the desktop and core clr and hence you would put it in the
dependencies
section common to both frameworks.