dotnet publish does not copy the documentation file with csproj
See original GitHub issueSteps to reproduce
Have a solution with multiple projects The main “web” project has the GenerateDocumentationFile set to true
Expected behavior
When I run dotnet publish of the main “web” project, I expect that the XML documentation file is copied into the publishing folder. (Note the build will generate the file as it should.)
Actual behavior
When I run dotnet publish of the main “web” project, it does not copy the XML documentation file to the psublish folder.
My workaround
My current workaround is to update the csproj of the main web project and manually copy the file:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<ItemGroup>
<DocFile Include="bin\**\**\PROJECT_XYZ.xml" />
</ItemGroup>
<Copy SourceFiles="@(DocFile)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="false" />
</Target>
Environment data
.NET Command Line Tools (1.0.0-rc3-004530)
Product Information: Version: 1.0.0-rc3-004530 Commit SHA-1 hash: 0de3338607
Runtime Environment: OS Name: Windows OS Version: 6.3.9600 OS Platform: Windows RID: win81-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc3-004530
This issue has been copied over from https://github.com/dotnet/cli/issues/5562.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:27
- Comments:54 (27 by maintainers)
Hello @davkean , My project is a big WebAPI netcore and like many API, I’m using Swagger whom needs the XML documentation file if I want to have a good documentation for my API. Also, it use to work when I was using .xproj.
Also, another of my project (solution with multiple projects) has the flag GenerateDocumentationFile turned On and somehow that one is copied over.
So in a nutshell, it use to work and now I see two different things contradicting themselves.
thank you, JS
@masterjs What’s the expectation around this? Why do you expect the XML file to be published - it’s a dev artefact.