0

I'm trying to read from a text file that contains some data in my bot. I have the file in my Visual Studio solution and the bot is able to read the data fine when I am using the Emulator.

However, when I publish, it says that the file doesn't exist (IO.DirectoryNotFoundException) and gives this path as the path it's looking at (my file is in the Data\Holidays folder in Visual Studio):

D:\home\site\wwwroot\Data\Holidays\Holidays.txt

Is the path different when it's published? Do I have to upload the text file to Azure manually?

Thanks!

oysterhey
  • 3
  • 1

1 Answers1

0

Do you include the file as a part of your project? (after build, check your bin folder). If not, then please include your file.

For more details you may try these links

1)Entity Framework - How to get relative file path in seed method

2)ASP.NET Web application file path (Publish on Azure)

UserP
  • 194
  • 13
ShrutiJoshi-MT
  • 1,622
  • 1
  • 4
  • 9