0

In our "vintage" ASP.NET project we configured NWebSec through the web.config file. Now we have a ASP.NET Core subproject where the NWebSec rules from the main project don't seem to bubble down. Also I could not really figure out how to configure NWebSec in a Core project besides using Attributes.

https://docs.nwebsec.com/en/latest/nwebsec/Configuring-csp.html

What I really want is one central place to do the configuration, otherwise I know we will end up with two completely out of sync configs...

I'm not yet a .NET Core expert, but my impression was that the web.config file is not used anymore, otherwise we could do something like that:
Using configSource with NWebsec

Remy
  • 12,555
  • 14
  • 64
  • 104
  • `What I really want is one central place to do the configuration` You can try to install [NWebsec.AspNetCore.Middleware](https://www.nuget.org/packages/NWebsec.AspNetCore.Middleware/) and configure CSP middleware to achieve it. – Fei Han Feb 10 '20 at 09:54
  • Thanks. But that Middleware only seems to work for .NET Core, no? – Remy Feb 25 '20 at 17:16

0 Answers0