Could someone explain what the differences are between the root dependencies object, configurations.net45.dependencies and configurations.k10.dependencies? When and how should I use them?
Also, is there any way to bring in other dependencies built in a non-vNext environment? Either as Nuget or plain DLL:s.
You can add any nuget package in project.json as dependencies.
For example, AutoFac is not available in Core CLR(k10). So, you will be add it on net45 dependencies, telling that only add AutoFac when I use net45
instead of k10.
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Dependencies can either be shared amongst all configurations, or they can be configuration-specific. The two main types of configurations are "net45"/"net451" which are the regular .NET that's been around for a while, and "k10", which is the new cloud-optimized
CLR.
I was confused about adding regular Nuget packages to project.json because they don't show up in the intellisense for me. Plus, it doesn't compile when I hit build. Some type of bug in the current version? It works fine once I tried to simply run the application.
NuGet packages should show up in Intellisense as long as they're available from the feeds that are available to the project. Check if you have a NuGet.config file in the project (or in a parent folder) that changes/restricts the list of NuGet package feeds.
Not sure why it's not able to build - do you see any errors? Is the button disabled? Can you check the various "Output" windows in VS? (There's a dropdown in there to pick which output you want to see.)
I do have a nuget.config that references both the aspnetvnext at myget.org and the regular feed at nuget.org. Only packages I see in the intellisense are the vnext ones. It does install them though, if I write the correct name and version.
So, for example, I have referenced "EventStore.Client" in the root dependencies, and basically just wrote a line of code that creates an instance of a type from that package. Intellisense tells me that everything is fine. Building the project or the whole
solution gave an error that there is no namespace "EventStore". Clicking Start debugging in VS would run the application just fine though.
But I realized now that when I remove the k10 configuration element from my project.json it started building just fine.
So first of all, I guess VS will build everything once for each configuration in project.json? Not just the active one.
Secondly, I wonder if it's expected that I can't use regular Nuget packages with the k10 configuration?
As you realized, the tooling will build all target platforms. Also, k10 is a whole new target platform and only a very small subset of existing packages will work with it. Everything needs to be recompiled to work with the new profile so yes it's expected.
David Fowler
Principal SDE, ASP.NET Team, Microsoft
That's actually great - that it checks whether all configurations build, not just the active one.
Just one more question though:
The intellisense for packages in project.json only lists packages from the aspnetvnext feed (confirmed in Fiddler). Is that also expected behaviour? I have more feeds listed in my nuget.config.
"Only packages I see in the intellisense are the vnext ones"
This is by design for this release. In a future version we will pull from the feeds that are configured.
"So first of all, I guess VS will build everything once for each configuration in project.json? Not just the active one."
Correct, we will build for all configuration values defined in project.json. Later we will provide UI for you to chose which configuraitons to build for.
"Secondly, I wonder if it's expected that I can't use regular Nuget packages with the k10 configuration?"
As Fowler previously stated; only a very small subset of existing packages will work with it.
"Only packages I see in the intellisense are the vnext ones"
This is by design for this release. In a future version we will pull from the feeds that are configured.
This is not really true. I clearly got "Bootstrap" in the list of supported packages, but according to David Fowl Content packages are not supported yet.
Member
1 Points
6 Posts
project.json dependencies, dependencies, dependencies
Jun 12, 2014 01:35 PM|fjantomen|LINK
Could someone explain what the differences are between the root dependencies object, configurations.net45.dependencies and configurations.k10.dependencies? When and how should I use them?
Also, is there any way to bring in other dependencies built in a non-vNext environment? Either as Nuget or plain DLL:s.
Thanks.
All-Star
33953 Points
8478 Posts
MVP
Re: project.json dependencies, dependencies, dependencies
Jun 14, 2014 03:29 PM|imran_ku07|LINK
Root dependencies are your application dependencies means your application depend upon. k10(Core CLR) is not include complete BCL, so if you need to add a BCL feature then you will add the dependencies in k10. Core CLR has many extra dependencies as the packages that make up the BCL need to be referenced.
You can add any nuget package in project.json as dependencies.
For example, AutoFac is not available in Core CLR(k10). So, you will be add it on net45 dependencies, telling that only add AutoFac when I use net45 instead of k10.
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Contributor
2532 Points
1006 Posts
Microsoft
Re: project.json dependencies, dependencies, dependencies
Jun 15, 2014 11:26 PM|Eilon|LINK
Dependencies can either be shared amongst all configurations, or they can be configuration-specific. The two main types of configurations are "net45"/"net451" which are the regular .NET that's been around for a while, and "k10", which is the new cloud-optimized CLR.
You can learn more on the project's wiki: https://github.com/aspnet/Home/wiki/Project.json-file
Thanks,
Eilon
Member
1 Points
6 Posts
Re: project.json dependencies, dependencies, dependencies
Jun 16, 2014 05:57 PM|fjantomen|LINK
Thanks.
I was confused about adding regular Nuget packages to project.json because they don't show up in the intellisense for me. Plus, it doesn't compile when I hit build. Some type of bug in the current version? It works fine once I tried to simply run the application.
Contributor
2532 Points
1006 Posts
Microsoft
Re: project.json dependencies, dependencies, dependencies
Jun 17, 2014 12:05 AM|Eilon|LINK
NuGet packages should show up in Intellisense as long as they're available from the feeds that are available to the project. Check if you have a NuGet.config file in the project (or in a parent folder) that changes/restricts the list of NuGet package feeds.
Not sure why it's not able to build - do you see any errors? Is the button disabled? Can you check the various "Output" windows in VS? (There's a dropdown in there to pick which output you want to see.)
Member
1 Points
6 Posts
Re: project.json dependencies, dependencies, dependencies
Jun 17, 2014 01:22 AM|fjantomen|LINK
I do have a nuget.config that references both the aspnetvnext at myget.org and the regular feed at nuget.org. Only packages I see in the intellisense are the vnext ones. It does install them though, if I write the correct name and version.
So, for example, I have referenced "EventStore.Client" in the root dependencies, and basically just wrote a line of code that creates an instance of a type from that package. Intellisense tells me that everything is fine. Building the project or the whole solution gave an error that there is no namespace "EventStore". Clicking Start debugging in VS would run the application just fine though.
But I realized now that when I remove the k10 configuration element from my project.json it started building just fine.
So first of all, I guess VS will build everything once for each configuration in project.json? Not just the active one.
Secondly, I wonder if it's expected that I can't use regular Nuget packages with the k10 configuration?
Contributor
2292 Points
908 Posts
Microsoft
Re: project.json dependencies, dependencies, dependencies
Jun 17, 2014 02:04 AM|davidfowl|LINK
As you realized, the tooling will build all target platforms. Also, k10 is a whole new target platform and only a very small subset of existing packages will work with it. Everything needs to be recompiled to work with the new profile so yes it's expected.
Principal SDE, ASP.NET Team, Microsoft
Member
1 Points
6 Posts
Re: project.json dependencies, dependencies, dependencies
Jun 17, 2014 03:08 PM|fjantomen|LINK
Ok, thanks!
That's actually great - that it checks whether all configurations build, not just the active one.
Just one more question though:
The intellisense for packages in project.json only lists packages from the aspnetvnext feed (confirmed in Fiddler). Is that also expected behaviour? I have more feeds listed in my nuget.config.
Contributor
2532 Points
1006 Posts
Microsoft
Re: project.json dependencies, dependencies, dependencies
Jun 20, 2014 04:11 PM|Eilon|LINK
Not sure about why the packages aren't showing up - I forwarded this thread to a couple of folks who might know.
Member
60 Points
23 Posts
Microsoft
Re: project.json dependencies, dependencies, dependencies
Jun 20, 2014 09:10 PM|sayed.hashimi|LINK
"Only packages I see in the intellisense are the vnext ones"
This is by design for this release. In a future version we will pull from the feeds that are configured.
"So first of all, I guess VS will build everything once for each configuration in project.json? Not just the active one."
Correct, we will build for all configuration values defined in project.json. Later we will provide UI for you to chose which configuraitons to build for.
"Secondly, I wonder if it's expected that I can't use regular Nuget packages with the k10 configuration?"
As Fowler previously stated; only a very small subset of existing packages will work with it.
Member
146 Points
86 Posts
Re: project.json dependencies, dependencies, dependencies
Jun 24, 2014 08:35 AM|MartinJ.|LINK
This is not really true. I clearly got "Bootstrap" in the list of supported packages, but according to David Fowl Content packages are not supported yet.