I am trying to add a customer header to web.config file in staging.pubxml, in VS 2022.
I get “The element beneath element is unrecognized”. What is the problem here or is there a better way?
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<EnvironmentName>Staging</EnvironmentName>
<DeleteExistingFiles>True</DeleteExistingFiles>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>C:Publish6StagingPRJ6PRJ6.Engine</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
</PropertyGroup>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="content-security-policy" value="frame-ancestors https://*.example.com https://example.com" xdt:Transform="Insert" xdt:Locator="Match(name)" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
</Project>