hi all
i am just beginner in c# and i try to make a project which includes notifyicon
actually i completed my project..it work without problem when i run it
but i want to make its exe file to use it in another pc also..but when i try to make its exe by using csc prompt (vs 2008) it gives such an error :
Form1.cs (21,32) : error cs0103 : the name 'DisKaynak' doesnt exist in the current context
DisKaynak is the name of my resource file (DisKaynak.resx)
i have such a code line in the project :
notifyicon1.Icon = DisKaynak.myIconName ;
i dont know if only this line is enough to read the icon from the resource or should i write more codes there
so how can i get rid off that error
i will be happy if u help me
Loading
Erdinc KolukisaPosted Sep 11, 2009, 3:41 AM
thanks for help
but this time i got a different error
it says like "Unhandled exception has occured in your application.Click continue the application will ignore this error an attemp to continueiIf u click Quit the application will close immediately"
value of 'null' is not valid for 'stream' it says
but in my project file icon exist.so why it turns null value ??
Master BillaPosted Sep 10, 2009, 10:51 PM
If you need attached as embbed resource file in dll, you need just keep as default properties to the resource file and then you need write code in global resource acccess.
for example see this sample
this.button2.Image = global::WindowsFormsApplication4.Properties.Resources.ReportScreen;
Thank you
Roei BarPosted Sep 10, 2009, 2:26 PM
change the way you get the icon to the following :
Erdinc KolukisaPosted Sep 10, 2009, 5:27 AM
but still i have the same error
can it be because of namespaces that i have in my project
i have below namespaces :
using System ;
using System.Collections.Generic ;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text ;
using System.Windows.Forms;
using System.Resources ;
using System.Globalization;
using System.Reflection;
i have this namespaces they are too many or should i add more ?
Roei BarPosted Sep 10, 2009, 5:15 AM
stand on the resx file -> goto properties and change to embeded resource
this way it will work with the code you specified on any machine since it will be embeded in the exe
Erdinc KolukisaPosted Sep 10, 2009, 5:02 AM
i did what u said but still i have the same error :(
Master BillaPosted Sep 10, 2009, 4:49 AM
You can do it, just right click in resource file and select properties, then select the Build action "Content" and also then select the Copy of output directory to "Copy always".
then you can try it will work
Thank you