Publishing on Azure - Filenotfoundexception: Could not find file’D: home site wwwroot myapp.xml'

Asked

Viewed 383 times

1

I am trying to publish an ASP.NET Core Web Api application for an Azure App Api feature.

This error started to appear after I marked "Remove Additional files at Destination":

inserir a descrição da imagem aqui

And after that, I started getting the bug and I couldn’t make it work anymore.

This error occurs when the app tries to find the . XML file for Swagger. I have the following code for this:

// Determine base path for the application.
var basePath = PlatformServices.Default.Application.ApplicationBasePath;

// Complete path
var xmlPath = 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 the XML documentation:

inserir a descrição da imagem aqui

Works perfectly running site on my machine.

Any ideas, please?

  • Mark the checkbox again (?)

  • @LINQ seems obvious, but it doesn’t work haha

  • Putz. But the file is being sent? No error in publishing?

  • The file is being sent and there is no error at Publish time. Everything 100%. I’ve already changed the path where the . XML is generated, already put to "copy always" and nothing done. I already deleted the Azure resource and added again and the error persists. Bizarre.

1 answer

1

It’s been a long time and there’s no answer here, but follow my solution:

I solved this problem by putting the correct output in the project properties, mainly in the mode Release, and then publishing again on Azure.

Release

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.