Image file issue while running the setup file/exe file from published folder or release folder
Hi,i am using .net 2015 windows application. added some of the icons files into project. its working fine in debug and release mode. But after creating a set up file of that project like publishing and or using release folder set up file, i am getting some issue for the icons files. In set up file, could not get the icons and showing the error.
System.IO.FileNotFoundException: ../../Resources/Incoming.ico
at System.Drawing.Image.FromFile(String filename, Boolean useEmbeddedColorManagement)
at TrayApp.MenuStrip.Recent_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripDropDownItem.OnDropDownShow(EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnDropDownShow(EventArgs e)
at System.Windows.Forms.ToolStripDropDownItem.ShowDropDownInternal()
at System.Windows.Forms.ToolStripDropDownItem.ShowDropDown(Boolean mousePush)
at System.Windows.Forms.ToolStripMenuItem.OnMenuAutoExpand()
at System.Windows.Forms.MenuTimer.OnTick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, Int..
==============================
some of the codes
public const string INCOMING = "../../Resources/Incoming.ico";//"CCclick2dial.Properties.Resources.Incoming.ico"; //
public const string OUTGOING ="../../Resources/Outgoing.ico";
public const string MISSED = "../../Resources/Missed.ico";
====
void Recent_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).DropDownItems.Clear();
string[] cllog = CallLogManager.ReadLogFile();
string exefile = (new System.Uri(Assembly.GetEntryAssembly().CodeBase)).AbsolutePath;
string exedir = Path.GetDirectoryName(exefile);
string inico = Path.Combine(exedir, "..\\..\\Resource\\Incoming.ico");
string Missico = Path.Combine(exedir, "..\\..\\Resource\\MIssed.ico");
string outico = Path.Combine(exedir, "..\\..\\Resource\\Outgoing.ico");
Your suggestion required ASAP.
Thanks.