Ted Nyberg Ted Nyberg - 1 year ago 132
ASP.NET (C#) Question

Publish command for ASP.NET Core project only includes DLL files

I'm trying to publish an ASP.NET Core 1.0 project, in order to be able to deploy it to Azure (or other hosting environments) later on.

My folder structure is as follows (not sure if it matters):

|_Bar -> contains project.json

From the root folder I run the publish command like so:

dotnet publish Foo/Bar -o artifacts\FooBarOutput --configuration Release

This creates a folder with output from the
command, but it only contains assemblies (DLL files) and a folder called
containing referenced assemblies.

My question is: how do I create a complete publish package, including all static resources such as HTML, JavaScript, CSS, configuration files, etc?

Am I missing something in my
file, or some parameters for the
command? I must be missing something, but I guess there must be some way to specify that the
folder etc should be included in the output?

file looks like the following:

"title": "My Web App",
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true,
"compile": {
"exclude": [ "bin/**", "obj/**", "node_modules/" ]
"dependencies": {
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"System.IO.FileSystem": "4.0.1"
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0"
"imports": "dnxcore50"
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://*:8000/"

Answer Source

You need to add publishOptions section in your project.json like this :

"publishOptions": {
    "include": [
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download