0

I created a WPF app using c# in which I have ContextMenuStrip with images.. I am using custom action to launch my application after installation.. As App launches first time it gives me exception System.IO.FileNotFoundException

enter image description here

but when it is launched manually by double clicking desktop icon no exception is raised and works fine and all images are shown.. here's code of using image..

titleMenuItem.Image = System.Drawing.Image.FromFile("setting.ico")

but when I run application in visual studio no exception is raised.. and I am using visual studio installer if it matters..

What I have tried:

I tried putting the images in bin/debug folder of project and in Application Folder of setup..

Clemens
  • 123,504
  • 12
  • 155
  • 268
  • 2
    Possible duplicate of [Image.FromFile File Not Found](https://stackoverflow.com/questions/38817660/image-fromfile-file-not-found) – Abdul Rauf Aug 13 '18 at 07:13
  • I will try try 2 things: 1. Change path to full path (like C:\setting.ico) and try then 2. Generate message box with current path and see if it's the same in both application runs. – titol Aug 13 '18 at 07:21
  • but i am getting image when app is launched second time.. – Abhijeet Pratap Singh Aug 13 '18 at 10:19

0 Answers0