Hi.
I wrote a project in C# and I want to release it and execute it in another computer.
My Project uses some files that are in my computer's hard disk, for example D:\MyProject\MyIcon.ico and so on.
when I copy "Release" Folder in "MyDocument" to another computer it throws an IOExeption because, it can't find that files.
What should I do to solve my problem?
Thanks.
How to release a project ?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Aaron Colen30 reputationPosted Sep 13, 2010, 5:52 AM EDT
Right click your project under Solution Explorer and choose Properties.
On the Resources tab (on the left) you can add icons, bitmaps... and they will be built into the .exe.
You will then have to change references to the files to Properties.Resources.FileNameHere
For some reason Icons don't like being attached to forms when added this way but you can get around it by assigning the icon after "InitializeComponent();" like:
public Form1()
{
InitializeComponent();
this.Icon = Properties.Resources.MainIcon;
}
Majid KamaliRank #6,453 · 266 reputationPosted Sep 14, 2010, 4:57 AM EDT
Aaron Colen30 reputationPosted Sep 14, 2010, 6:20 AM EDT
Using the Setup Project you can change install location, icons...
Sam HobbsRank #107 · 20.5K reputationPosted Sep 14, 2010, 9:32 PM EDT