It always takes the path from where the executable is located (bin folder). Therefore, if you can access it using the full path, the problem will be solved. Or you can have a configuration item for the root folder. then access, for example Image.FromFile(rootFolder+ "Resources/circle.png");. In any case, this problem will not occur during deployment.
And if you use a resource file,
<projectName>.Properties.Resources.<ImageName>;
will return the image.
source
share