I have a WinForms application that relies on a class library DLL. Inside the class library there is a method that opens a file. While working inside Visual Studio IDE if I provide the wrong file path I get a FileNotFoundException as expected.
Why if I run the app outside VisualStudio the exception is not thrown?
Thanks.
EDIT: The path does not exist on disk, it’s wrong from any place/environment. The question is on why the exception can be seen inside VStudio IDE and not running the app from Bin/Release folder.
Perhaps you use relative path which is proper when you are out side.
Also check CurrentDir while running inside MSVS
UPDATE:
May be you have a handler for the exception (try/catch). MSVS shows that there is an exception and it goes to handler (normal situation). Outside of MSVs it just goes to handler