user27425749
user27425749

Reputation: 1

XML file is not being copied to output directory in .NET 8

I am working on a .NET 8 C# application that contains a XML file nested within multiple folders. I have set the properties of the XML file to have RootContent and "Copy Always" for the build action/copy to output directory setting, and the XML file is NOT being copied to the Debug\net8.0-windows folder as expected.

If I set the "Build Action" to "None", I get the nested folder structure in the debug, however, I need just the xml file in the main root output folder. My DLLs are copied correctly to the output folder so the output folder is there and created correctly - just for some reason this XML file is not copied to the output bin based on the properties set.

Note: my application was previously setup to run on .NET 4.8 where all of these settings worked correctly and copied the XML file to the output folder as expected.

I tried updating the .csproj manually, however, we could not get the XML file to output to the root directory by itself, i.e. not within the nested folders. RootContent I believe was supposed to handle this.

Upvotes: 0

Views: 146

Answers (0)

Related Questions