10

EDIT: Updated to specify that the issue only occurs when packaging an Azure cloud service CSPKG file.

I have an ASP.NET Web API 2 application that acts as a web role in an Azure cloud service solution. I'd like to use the Web API Help Pages and leverage the XML generated docs to populate them. I'm having trouble figuring out how to get the XML documentation to be included in the Azure cloud packaging of the Web Api project.

The XML documentation correctly makes its way into the bin directory locally and when being published to a file system location, but it's missing when you inspect the cspkg archive or the deployed web roles approot directory.

Is there a way to force the packaging to include the XML?

RMD
  • 3,421
  • 7
  • 39
  • 85

1 Answers1

14

You can set ExcludeXmlAssemblyFiles to false in your Project's PropertyGroup to force all xml files to be included in the Azure package:

<ExcludeXmlAssemblyFiles>false</ExcludeXmlAssemblyFiles>

sm85
  • 214
  • 2
  • 2
  • FYI - I had to add this to the Web API project file. Adding it to the cloud project had no affect. Thanks! – RMD Oct 13 '14 at 14:38
  • 1
    Mine is not working. I can see the xml file inside the bin folder, but it isn't inside the approot folder. I added this tag to the web project. Any help? – Luís Deschamps Rudge Apr 10 '15 at 00:04
  • 2
    I added this to the publish profile for my Web.API project (in Properties\PublishProfiles\xxx.pubxml. Worked a treat, thanks for the help! – Morgan Skinner Feb 03 '16 at 16:15
  • This answer did not work for me. The project file already had ExcludeXmlAssemblyFiles set to false. The strange thing is if I package the file from clicking on the cloud project in the solution the xml is included, but when I try doing this via command line with MSBuild.exe the xml file is missing. – Jazaret Mar 18 '16 at 20:41
  • I was perplexed at why this wasn't working for me as well, but then I remembered we have our build servers' build definitions customized to pass the argument `/p:AllowedReferenceRelatedFileExtensions=none` to msbuild (as an old workaround for [this](https://stackoverflow.com/a/23069603/251011) ), which makes the XML file get excluded regardless. – Mike Asdf Jun 03 '16 at 19:31
  • 1
    Was searching for an Hour... Adding this to the publish profileworked for me! Thanks – jmenzel Oct 28 '16 at 13:20