We no longer sell products directly from the GHI Electronics website, click here for more details. Please find a Distributor to complete your online order. If you have any questions regarding this notice please contact us at support@ghielectronics.com.

Namespaces

Last modified August 15, 2014

Working with our Gadgeteer Example Programs

Throughout our documentation, we often include program examples that you can cut and paste into Visual Studio (VS).  When you create a New Gadgeteer Project in VS, VS sets the default namespace for your project based on your project name. The Gadgeteer Designer creates a file named "Program.generated.cs" that uses this default namespace.

When the example code is a complete gadgeteer program, you will select it, and copy it. Then you will select all the lines in Program.cs in and paste the example code over the code in VS. Right away you will almost always have a problem, the namespace in Program.generated.cs will not match the namespace from the example code:

Always change the namespace in Program.cs to match the one in Program.generated.cs. Do not change Program.generated.cs.  This is because the namespace in Program.generated.cs is also used for any resources you may add to the program: 

    

Leave feedback about this document.
Let us know if the information presented here was accurate, helpful and if you have any suggestions.
Leave feedback about this document.
Let us know if the information presented here was accurate, helpful and if you have any suggestions.

* Indicates required fields.
This form is only for feedback not support.
Review our how to find information guide on locating helpful resources.