Here I want to cover some basics people often ask about:
1) How to add references to your project. This task is very basic but most new programmers have problems with that. So if your application doesn’t work on „another machine”, or you want to use something that’s „not in your Visual Studio but it is on your programmer friend’s Visual Studio :)” you might want to check your references.
All you have to do is open Solution Explorer and right click on the References in your project. Then choose „Add Reference”. New window will pop up, and you have for them to load. I’ve heard that „the main difference” between VS2008 and 2010 is that it doesn’t take eternity for them to load on VS2010 and well, it’s true 🙂
Anyway, you can choose Reference for the .NET package (.NET tab), COM or Browse for a DLL or something by yourself on the „Browse” tab (screen below):
2) You can easily change you target framework. There are numerous reasons for that. Maybe something doesn’t work on .Net 4.0 but it works on 3.5 or you target your app to older software. You can do that by right clicking on your project name in the Solution Explorer and choosing „Properties”. There on the „Application” tab you can choose „Target framework” (screen below):
3) Crating your own setup app for your app.
What many unexperienced people forget about is that the libraries you use doesn’t only have to be in your references. They also have to be included in the application folder (if you use something outside the .Net framework). So again – if your app doesn’t work on another machine, you might want to check if you included everything. And there is an easy way to do that.
Just click „Properties” in the menu that will pop up after right clicking on your project name in the „Solution Explorer” and choose „Publish” tab (on the botom). (screen below):
If you click on the „Application Files” button you will get a list of the files inlucded in your project. Some of the needed files aren’t included in your published project. You would have to include them (screen below):
4) The last thing I would want to write about is that there is a very simple way to add a Prerequisite to your app. For example: You have no idea if the client has .NET 4.0 installed on his computer. Just click „Prerequisites” button in your project’s „Properties” window and check the right checkbox. (screen below):
Of course you publish your „installer” by clicking the „Publish” button on the bottom of the „Properties” page.