Publishing in Azure - FileNotFoundException: Could not find file 'D: \ home \ site \ wwwroot \ myapp.xml'

1

I'm trying to publish an ASP.NET Core Web Api application to an Azure Api App feature.

This error started appearing after I checked the "Remove additional files at destination" option:

Andafterthat,Istartedgettingtheerrorandcouldnotgetittoworkanymore.

Thiserroroccurswhentheapptriestofindthe.XMLfileforSwagger.Ihavethefollowingcodeforthis:

//Determinebasepathfortheapplication.varbasePath=PlatformServices.Default.Application.ApplicationBasePath;//CompletepathvarxmlPath=Path.Combine(basePath,"myapp.xml");

// Set the comments path for the swagger json and ui.
options.IncludeXmlComments(xmlPath); 

And these are the project settings for XML documentation:

It works perfectly by running local on my machine.

Any ideas, please?

    
asked by anonymous 31.07.2017 / 19:24

1 answer

1

It has been a long time and has not had an answer here, but it follows my solution:

I solved this problem by placing the correct output in the project properties, especially in Release mode, and then posting again to Azure.

    
13.09.2018 / 16:19