Having a code that works for ages when loading and storing images, I discovered that I have one single image that breaks this code:
const string i1Pa
Just use the visual studio as administrator or run the application created by the code as administrator it should work smoothly. It is user access rights issue. I faced the same and resolved it by running visual studio as administrator.