|  | 
|  | 1 | +--- | 
|  | 2 | +title: csproj reference | .NET Core SDK | 
|  | 3 | +description: Learn about the differences between existing and .NET Core csproj files | 
|  | 4 | +keywords: reference, csproj, .NET Core | 
|  | 5 | +author: blackdwarf | 
|  | 6 | +ms.author: mairaw | 
|  | 7 | +manager: wpickett | 
|  | 8 | +ms.date: 10/12/2016 | 
|  | 9 | +ms.topic: article | 
|  | 10 | +ms.prod: .net-core | 
|  | 11 | +ms.technology: .net-core-technologies | 
|  | 12 | +ms.devlang: dotnet | 
|  | 13 | +ms.assetid: bdc29497-64f2-4d11-a21b-4097e0bdf5c9 | 
|  | 14 | +--- | 
|  | 15 | + | 
|  | 16 | +Additions to csproj format for .NET Core | 
|  | 17 | +---------------------------------------- | 
|  | 18 | + | 
|  | 19 | +# Overview  | 
|  | 20 | +This document outlines the changes that were added to the csproj files as part of the move from project.json to csproj and  | 
|  | 21 | +[MSBuild](https://github.com/Microsoft/MSBuild). This document outlines **only the deltas to non-core csproj files**. If  | 
|  | 22 | +you need more information about general project file syntax and reference, please consult [the MSBuild project file]() documentation.  | 
|  | 23 | + | 
|  | 24 | +> **Note:** this document will grow in the future, so please check back to see new additions.  | 
|  | 25 | +
 | 
|  | 26 | +# Additions | 
|  | 27 | + | 
|  | 28 | +## PackageReference | 
|  | 29 | +Specifies a NuGet dependency in the project. The `Include` attribute specifies the package ID.  | 
|  | 30 | + | 
|  | 31 | +```xml | 
|  | 32 | +<PackageReference Include="<package-id>"> | 
|  | 33 | +    <Version></Version> | 
|  | 34 | +    <PrivateAssets></PrivateAssets> | 
|  | 35 | +    <IncludeAssets></IncludeAssets> | 
|  | 36 | +    <ExcludeAssets></ExcludeAssets> | 
|  | 37 | +</PackageReference> | 
|  | 38 | +``` | 
|  | 39 | + | 
|  | 40 | +### Version | 
|  | 41 | +`<Version>` specifies the version of the package to restore. The element respect the rules of the NuGet versioning scheme. | 
|  | 42 | + | 
|  | 43 | +### IncludeAssets | 
|  | 44 | +`<IncludeAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should be  | 
|  | 45 | +consumed.  | 
|  | 46 | + | 
|  | 47 | +The element can contain one or more of the following values: | 
|  | 48 | + | 
|  | 49 | +* Compile – are the contents of the lib folder available to compile against | 
|  | 50 | +* Runtime – are the contents of the runtime folder distributed | 
|  | 51 | +* ContentFiles – are the contents of the contentfiles folder used | 
|  | 52 | +* Build – do the props/targets in the build folder get used | 
|  | 53 | +* Native - are the contents from native assets copied to the output folder for runtime | 
|  | 54 | +* Analyzers – do the analyzers get used | 
|  | 55 | + | 
|  | 56 | +Alternatively, the element can contain: | 
|  | 57 | + | 
|  | 58 | +* None – none of those things get used | 
|  | 59 | +* All – all of those things get used. | 
|  | 60 | + | 
|  | 61 | +### ExcludeAssets | 
|  | 62 | +`<ExcluseAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should not  | 
|  | 63 | +be consumed. | 
|  | 64 | + | 
|  | 65 | +The element can contain one or more of the following values: | 
|  | 66 | + | 
|  | 67 | +* Compile – are the contents of the lib folder available to compile against | 
|  | 68 | +* Runtime – are the contents of the runtime folder distributed | 
|  | 69 | +* ContentFiles – are the contents of the contentfiles folder used | 
|  | 70 | +* Build – do the props/targets in the build folder get used | 
|  | 71 | +* Native - are the contents from native assets copied to the output folder for runtime | 
|  | 72 | +* Analyzers – do the analyzers get used | 
|  | 73 | + | 
|  | 74 | +Alternatively, the element can contain: | 
|  | 75 | + | 
|  | 76 | +* None – none of those things get used | 
|  | 77 | +* All – all of those things get used. | 
|  | 78 | + | 
|  | 79 | +### PrivateAssets | 
|  | 80 | +`<PrivateAssets>` child element specifies what assets belonging to the package specified by parent `<PackageReference>` should be  | 
|  | 81 | +consumed but that they should not flow to the next project.  | 
|  | 82 | + | 
|  | 83 | +> **Note:** this is a new term for project.json/xproj `SupressParent` element.  | 
|  | 84 | +
 | 
|  | 85 | +The element can contain one or more of the following values: | 
|  | 86 | + | 
|  | 87 | +* Compile – are the contents of the lib folder available to compile against | 
|  | 88 | +* Runtime – are the contents of the runtime folder distributed | 
|  | 89 | +* ContentFiles – are the contents of the contentfiles folder used | 
|  | 90 | +* Build – do the props/targets in the build folder get used | 
|  | 91 | +* Native - are the contents from native assets copied to the output folder for runtime | 
|  | 92 | +* Analyzers – do the analyzers get used | 
|  | 93 | + | 
|  | 94 | +Alternatively, the element can contain: | 
|  | 95 | + | 
|  | 96 | +* None – none of those things get used | 
|  | 97 | +* All – all of those things get used. | 
|  | 98 | + | 
|  | 99 | +## DotnetCliToolReference | 
|  | 100 | +`<DotnetCliToolReference>` element specifies the CLI tool that the user wants restores in the context of the project. It is  | 
|  | 101 | +a replacement for the `tools` node in `project.json`.  | 
|  | 102 | + | 
|  | 103 | +### Version | 
|  | 104 | +`<Version>` specifies the version of the package to restore. The element respect the rules of the NuGet versioning scheme. | 
|  | 105 | + | 
|  | 106 | +## RuntimeIdentifiers | 
|  | 107 | +`<RuntimeIdentifiers>` element allows specifying a semicolon-delimited list of [Runtime Identifiers](../../rid-catalog.md) for the project.  | 
|  | 108 | +These allow publishing self-contained deployments.  | 
|  | 109 | + | 
0 commit comments