Working with Source Code


The source code for Ferpect includes one Visual Studio solution that include several projects. Most of the projects have dependencies on their relative positions within the Ferpect source tree, so it is recommended that they not be renamed or moved. The projects all have their output paths set to the Output subfolder, below the Ferpect solution.


You must have XNA Game Studio 4.0 installed to build the source code in this project. Please visit the XNA Creators Club Online web site for help if you have trouble installing. Otherwise, follow the links below.

The main solution works in Visual Studio 2010, Visual C# 2010 Express Edition, or Visual Studio 2010 Express for Windows Phone.

You must have WiX 3.0 to build the setup project. The FerpectSDK.sln file requires WiX 3.0 and Visual Studio 2008.

You must have MSBuildCommunityTasks installed to build the template projects.

If you're not trying to build the setup, then you don't need Visual Studio 2008.

Click for links to prerequisites.

Configuring the Dev Environment

Since Ferpect components customize the existing designer infrastructure in Visual Studio, you need to debug Visual Studio (devenv.exe) in order to debug the design-time code in this project. The target process needs to load a project that references the Ferpect component model, and contain code that represents a designable class. Then that code file needs to be opened in design view to get the designer to load the Ferpect binaries.

Working With Code

Before starting development on the Ferpect solution, it is advised that the default editor for components be set to the code editor. This is important to avoid accidentally opening the design view in the Ferpect solution. If the components are opened in design view, the IDE may load one or more of the output assemblies. Once loaded, the assemblies will be locked, and rebuilding them will fail. To recover from this situation, you need to restart the IDE.

To set the default editor, load the Ferpect solution and right-click on the ViewComponent.cs item in the Ferpect.ComponentModel project. Select Open With... and then change the default editor to the CSharp Editor.

openwith.bmp setdefault.bmp

Note: Changing the default editor will affect all instances of the IDE, until you change it back.


To debug Ferpect, launch Visual Studio under the debugger, and create a Ferpect game project in that IDE. To open MenuScreen.cs in design view, right-click the file in Solution Explorer and choose View Designer.

Be aware that there are several exceptions thrown in the designer infrastructure when loading the designer that are expected. They are handled by the designer infrastructure, and do not indicate problems or failures in the Ferpect code. If the debugger is configured to break on first-chance exceptions, then you'll need to either filter the exceptions, or get used to ignoring them.

Last edited Sep 15, 2010 at 6:21 AM by BadCorporateLogo, version 3


No comments yet.