Using Managed Code in a Project (Windows CE 5.0)
Code targeting the common language runtime, which is the foundation of the .NET Framework, is known as managed code, while code that does not target the common language runtime is known as unmanaged code.
Although Visual Studio provides a full suite of tools you can use to create and build managed code applications, Platform Builder provides basic functionality you can use to create a project that uses managed code.
To use managed code in a project
Create a workspace or open an existing workspace.
From the File menu, choose New Project or File.
On the Projects tab, choose the type of project you want to create, enter a name and location for the project, and then choose OK.
It is recommended that you choose WCE Application or WCE Console Application because these project types enable you to use the New Project Wizard to create an empty project.
Optional. Enter information for the associated Readme.txt file.
Choose Next.
Choose An empty project and then choose Finish.
Create a file and save it as a .cs file.
On the FileView tab, expand the node for your new project and select the Source files folder; then from the shortcut menu, choose Add Files and add the .cs file you created.
The file appears in the Source files folder.
From the Project menu, choose Settings.
On the General tab, change Target Type to the type of managed code you want.
On the C++ tab, verify that Executable Entry Point is cleared.
This removes the EXEENTRY entry in the sources file for your project. For more information, see EXEENTRY.
On the Managed Code tab, configure the managed code settings for your project.
For more information, see Project Settings: Managed Code.
In the Managed References field, enter the following values, which are required for your project to run, separated by semicolons.
- $(_MANAGED_FRAMEWORK_DIR)\mscorlib.dll
- $(_MANAGED_FRAMEWORK_DIR)\system.dll
Add any other values that your managed code project requires to run.
Choose OK to save your changes.
When you are ready to build your managed code project, on the FileView tab, select the project.
From the Build Project menu, verify that Clean Before Building and Make Run-Time Image After Build are selected.
From the shortcut menu, select Build Current Project.
See Also
Creating a Project | Sources File
Last updated on Thursday, February 02, 2006
Send Feedback on this topic to the authors