Winforms report viewer resets Directory.CurrentDirectory

0 Answers 5 Views
Report Viewer - WinForms
Richard
Top achievements
Rank 1
Iron
Iron
Iron
Richard asked on 12 Jan 2026, 11:19 AM

I have an old VB.NET(.NET8) winforms app which loads some resources on sign in using 

Image.FromFile("resources\\myImage.png"

This is loaded from the resources sub folder in the runtime directory - so far so good. I also allow the user to change the "focus" of the application, which loads a different image, again so far so good - all of the images are correctly found.

However, if I show the Winforms report viewer, the Directory.CurrentDirectory is reset from the correct runtime folder to the folder which contained the report (which is a UNC share)

This means that loading the images fails - it's looking in the reports directory rather than the runtime directory.

Any one have any ideas on how to solve this?

No answers yet. Maybe you can help?

Tags
Report Viewer - WinForms
Asked by
Richard
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or