nr: #1 dodano: 2016-01-14 16:01
First of all I would forward you to the part of documentation, which describes
"projects": [ "src", "test" ],
version (and optionally
architecture) are important because your computer have multiple versions of
dnx.exe. You can examine
%USERPROFILE%\.dnx\runtimes directory to see all the installed runtimes. The
"sdk" part of
global.json defines the version of
dnx.exe from one of the runtimes which you installed.
It's important to understand about
"projects" part of
global.json that it will be scanned all sibling folders on any level under every from the directory. Every
project.json, which will be found, will be interpreted as the project of the solution.
You can for example download some part of ASP.NET and place it in the new subfolder of your solution hierarchy. For example you can download RC1 source of Entity Framework 7 (the file) any extract the zip-file in new
ef folder inside of
src folder of your project. You will see that, short time after reopening of the solution, the list of your project will be longer and longer and all Entity Framework 7 components will be included in your solution. In the same way you can extract the downloaded sources in separate directory
C:\aspnet\EF7 and to use
"projects": [ "src", "c:/aspnet/EF7" ],
You will have the same effects. If you later decide to remove debugging the sources of Entity Framework 7 then you should just exclude
global.json and then remove in Visual Studio previously added projects by selection in Solution View and click Del key.
I think that it should clear the possibilities which you have in the folder structures.
One more very important optional file, which could exist in the solution hierarchy, is
NuGet.config file. It defines NuGet feed, where the packages will be loaded. The problem is that there are many NuGet repositories (see the answer), which have different preliminary versions of ASP.NET 5 components. If you use the exact dependencies like
then one need just have the explicit version in the NuGet repository. The problem is that sometimes one uses the dependency like
to load the latest build of the package. If you would use wrong NuGet feed then you can get early RC2 builds, which are incompatible with other RC1 packages (at least because of renaming of many components between beta versions). To be sure that your solution (all your projects) uses RC1 you can place the following
NuGet.config in your solution folder (on top of all projects) for example the following content
<?xml version="1.0" encoding="utf-8"?>
<clear /> <!-- ensure only the sources defined below are used -->
<add key="automatic" value="False" />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetmaster/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="AspNetVNext" value="true" />
<add key="NuGet" value="true" />
See the documentation. I recommend you to open command line in some project folder and to execute
dnu feeds list
command. It will shows that all the
NuGet.config from the current and the parent folders and the global file
%appdata%\NuGet\NuGet.Config will be combined. NuGet will be search for packages in on all active repositories. It will be https://api.nuget.org/v3/index.json and https://www.myget.org/F/aspnetmaster/api/v3/index.json in the above case.
Possible conflicts could be if multiple
NuGet.config exist, points different NuGet feeds or enable/disable some feeds. The command
dnu feeds list helps here. You should always scan for all
NuGet.config files in your project hierarchy to prevent/resolve the conflicts. The resolution of many conflicts consist mostly in usage of correct feeds or the usage of explicit versions for resolution of packages.
I recommend you to read the article, which describes NuGet Configuration Inheritance.
I hope that you could decide which structure would be better for your existing environment. I would you recommend to hold the standard structure
and to place
NuGet.config in the solution directory. The default place for the test-projects: separate from the main projects:
(you can examine the structure of Entity Framework 7 on GitHub or MVC6 here). You can follow the structure or to choose another location and to modify
"projects" part of the