Share via


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

  1. Create a workspace or open an existing workspace.

  2. From the File menu, choose New Project or File.

  3. 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.

  4. Optional. Enter information for the associated Readme.txt file.

  5. Choose Next.

  6. Choose An empty project and then choose Finish.

  7. Create a file and save it as a .cs file.

  8. 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.

  9. From the Project menu, choose Settings.

  10. On the General tab, change Target Type to the type of managed code you want.

  11. 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.

  12. On the Managed Code tab, configure the managed code settings for your project.

    For more information, see Project Settings: Managed Code.

  13. 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
  14. Add any other values that your managed code project requires to run.

  15. Choose OK to save your changes.

  16. When you are ready to build your managed code project, on the FileView tab, select the project.

  17. From the Build Project menu, verify that Clean Before Building and Make Run-Time Image After Build are selected.

  18. 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

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.