Views/Shared/Index.cshtml
Views/_Layout.cshtml
Images/Logo/Logo.png
Images/Logo/LogoBW.png
Images/Screen1.png
Shared/Helper.cs
Shared/Helper.vb
Shared/~Helper.cs
Scripts/publish.cmd
Scripts/remove.cmd
build.cmd
Views/Shared/Index.cshtml
Views/_Layout.cshtml
Scripts/publish.cmd
Scripts/remove.cmd
Scripts/build.cmd
Shared/Helper.cs
RootNamespace.Images.Logo.Logo.png
RootNamespace.Images.Logo.LogoBW.png
RootNamespace.Images.Screen1.png
project.json
can contain a contentFile section.
{
...
"packageOptions":
{
"packInclude" : {},
"contentFiles":
{
"images/**/*.png": {
"buildAction": "EmbeddedResource",
"copyToOutput": false
},
"shared/*.cs": {
"exclude": "~*.cs",
"buidAction": "compile",
"target": "dotnet5.4",
"language":"cs"
},
"Views":
{
"copyToOutput": true
},
"*.cmd":
{
"flatten": true,
"outputPath": "scripts",
"copyToOutput": true
}
}
}
...
}
Content files section can be object where keys are treated as include attribute or array of objects.
"contentFiles":
{
"*.txt":
{
"copyToOutput": true
},
"*.md":
{
"copyToOutput": true
}
}
"contentFiles":
[
{
"include": ["*.txt", "*.md"],
"copyToOutput": true
}
]
Attribute | Description |
---|---|
include | [Required attribute] String or array of strings. Include provides either a file path or a wild card path. Examples: **/* , **/*.cs , any/any/myfile.txt , **/net*/* . |
exclude | String or array of strings. Exclude provides either a file path or a wild card path. All matching files will be excluded from the include. |
buildAction | Build action taken by msbuild for the content items. Examples: None , Compile |
copyToOutput | If True the content items will be copied to the build output folder |
outputPath | Sub folder name inside build output folder to copy files to is relative to build output folder |
flatten | If False the content items will be copied to the output folder using the full folder structure from the nupkg. By default paths are relative to project.json location |
language | Use this content file node only if referencing project targets specific language. Examples: any , cs , vb , fs |
target | Use this content file node only if referencing project targets specific framework. Examples: any , net451 , dotnet5.4 |
Attribute | Value |
---|---|
buildAction | None |
copyToOutput | True |
flatten | False |
language | any |
target | any |
There is discussion around default buildAction and copyToOutput values: @yishaigalatzer argues that default should not be different from .nuspec
default which is Action=Compile, Copy=false
or shoud force user to select build action.
/cc @davidfowl @DamianEdwards