Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle path on azure for XmlDocumentationProvider

I am using azure for deployment of my new Web API's, I am new with deployment on IIS and azure.

I have added my Web API's on azure as web application, and it's working fine, till I added documentation for each API's functions. After adding description I uncomment line below from HelpPageConfig.cs.

config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));

It's working finr locally, and I am able to see all descriptions, but when I published it on azure, I am getting error saying,

Could not find a part of the path 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.

site url : http://mejodo.azurewebsites.net/

Do I need to change path ?

File is already created in my system on D:\home\site\wwwroot\App_Data directory.

What changes I need to do to make it work ?

like image 583
Keval Patel Avatar asked Nov 30 '25 05:11

Keval Patel


1 Answers

I had the same issue. For me the file was generated. Please follow the below steps.

  1. Click on show all files in solution explorer.
  2. Check whether you have a file in App_Data folder
  3. If you have the file, right click and include the same in your project.
  4. Now build and publish to Azure.

I hope this will work. Thanks

like image 112
Sibeesh Venu Avatar answered Dec 02 '25 03:12

Sibeesh Venu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!