Build Error (Cannot read ntdll.pdb and FileNotFoundException is not handled)

Eddie0428 96 Reputation points
2021-08-25T01:34:04.667+00:00

I'm a beginner as C# programmer and I've just started studying Visual Studio.
I'm programming with console application to read file and display the content on MS console. I was expected to program exception of FileNotFound, but complier said FileNotFoundException is not handled. Could your please give me advice on how to fix this error? Thank you very much!126182-samplecode.png126155-ntdll.png

Developer technologies | C#
{count} votes

Accepted answer
  1. Eddie0428 96 Reputation points
    2021-08-25T11:39:30.04+00:00

    @Timon Yang-MSFT ,@Viorel , Thanks for your comments! As for @Viorel 's question, nothing is changed after my code was simplified such as "Hello World!"

    I found one issue: I created this project which was not for .NET framework. What I created was for running .NET Core on Windows, Linux, macOS. After creating a console project for .NET Framework, my code works. It seems like creating the wrong project caused this issue even though it is not straightforward solution.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.