1. Home
  2. Docs
  3. Getting Started
  4. Installation
  5. Additional Steps for .Net Core / .NET 5.0 / .NET 6.0

Additional Steps for .Net Core / .NET 5.0 / .NET 6.0

With .Net core nuget package, there are some additional steps to get dotnet Report running locally in your project. The same steps apply to .NET 5 Framework as well.


It’s always a good idea to checkin your code before adding the dotnetreport nuget package.

Need to get files locally in your project, there are 3 setups:

Step 1:

Unload your project and add GeneratePathProperty= “true” dotNetReport.core package reference.

Second, add the following to your project to copy front end files included in your project directly rather than as a reference.

$(PkgdotNetReport_core)\contentFiles\any\any\

Third, build the project, don’t worry about errors, but you should notice that the references are gone, and these files are now part of the project.

Finally, remove the entire CopyDotNetReportContent block, otherwise the project will keep overwriting your file changes. We don’t need it anymore.

Step 2:

Client-side packages need to be added to your package.json file.

The list of libraries dotnet Report uses from npm is included package.dotnetreport.json. Please manually merge the contents into your project’s actual package.json. If you don’t have one, just rename this file to package.json.

Then run gulpfile.dotnetreport.js (merge it in with your gulpfile, if you don’t have one, just rename this file to gulpfile.js). Visual Studios task runner will look file the file called gulpfile.js and pull out all the tasks within it. The task runner window may not be open by default, so to open it type task runner in the search box and select it from the results.

Alternatively, you can right click the gulpfile in the solution and select Task Runner from the context menu.

The task runner window will open at the bottom of the screen and will list out all the gulp tasks found within the gulpfile.js file. If the front end devs have organised the tasks into separate files, as long as the gulpfile.js file in the root of the project has some way of referencing them, they will still show up.

If you don’t see any of the tasks and have only just added the file or a task to the file. You may need to click the refresh button.

To run a task, simply right click it and then choose Run.

Step 3:

Addition of static config to the Project.

For .NET 5.0 or less:

Add Static Config to your Startup.cs

public Startup(IConfiguration configuration)
{
    Configuration = configuration;
    StaticConfig = configuration; //<--- Add this line manually
}

For .NET 6.0:

Add Static Config to your Program.cs

StaticConfig = builder.Configuration; //<--- Add this line manually
var app = builder.Build();

If your project is not using controller with Views, you would also need to add Controller with Views and set NewtonSoft Json setting in your Startup.cs / Program.cs (For .NET 6.0)

    services.AddControllersWithViews()
            .AddNewtonsoftJson(options => options.UseMemberCasing()); // <-- This is important otherwise javascript calls won't work

Also, add dotnet report keys to your appsettings.json file:

"dotNetReport": {

    "apiurl": "https://dotnetreport.com/api",
    "accountApiToken": "Your Account API Key",
    "dataconnectApiToken": "Your Data Connect Key",
    "privateApiToken": "Your Private API Key"

  },

  "ConnectionStrings": {
    "ConnectionKey": "Data Source=;Initial Catalog=;User ID=;Password=;"
  },

You should be able to build and run the project after the above changes.

Was this article helpful to you? Yes No

How can we help?