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!

0

1 Answer 1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.