Getting StartedThe source code for Ferpect includes several solutions that each 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.
PrerequisitesYou must have
XNA Game Studio 2.0 installed to build the source code in this project. Please visit the
XNA Creators Club Online:http://www.creators.xna.com web site for help if you have trouble installing. Otherwise, follow the links below.
You will require
one of either
Visual C# 2005 Express Edition SP1 or
Visual Studio 2005 SP1.
Click for links to
prerequisites.
Configuring the Dev EnvironmentSince Ferpect components customize the existing designer infrastructure in Visual Studio, you need to debug Visual Studio in order to debug the 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.
In order for a project to reference the libraries without a full path, the location of the Ferpect libraries need to be registered with the .NET Framework SDK. For convenience, the
Dev Setup solution (Dev Setup.sln) includes a small project that will build a utility to register the location of the Ferpect libraries. This utility must be run with administrator privileges. Once it has been run successfully, the
Dev Setup solution is no longer needed.
The
Ferpect solution (Ferpect.sln) contains five projects. Although the separation of the classes into respective assemblies may not be obvious, the purpose of the separation is to keep the runtime types from having strong dependencies on any design-time types. In addition, the general-purpose component model is separate from the specific use of those components in the game state library. Currently, it looks silly because there is only one class in the component library, but that will change as the component model is rounded-out.
Inside the
Ferpect solution is a project called
DebugVCSExpress. This project is unnecessary if you have Visual Studio 2005 Standard Edition or higher. To debug Ferpect, you need to launch Visual Studio (devenv.exe) or Visual C# Express (vcsexpress.exe). Since the Express editions lack any UI to configure a project to launch an external program, the
DebugVCSExpress project is pre-configured to do that. When it is set to the startup project, it will launch Visual C# 2005 Express under the debugger when you press
F5. If you are using Visual Studio Standard, you can configure any project to launch devenv.exe.
Working With CodeBefore 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.GameComponents project. Select
Open With... and then change the default editor to the CSharp Editor.
Note: Changing the default editor will affect all instances of the IDE, until you change it back.
DebuggingTo debug Ferpect, launch Visual Studio under the debugger, and load the
FerpectTest solution (FerpectTest.sln) in that IDE. To open MainMenuScreen.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.