Saturday, September 3, 2011

Compact Framework development in Oxygene 5

In the new Oxygene 5 for .NET compiler the "Framework Folder" option in the project options is no longer available. This means that there is no way to make a project compile against the Compact Framework.
The option was for example used in this video that demonstrates Prism Compact Framework development.

Because I needed to recompile a project for the CF, I started working on a custom .targets file.
.targets files are what MSBuild uses to find out for example what the framework folder is.

Here is a guide how to get this working:

  • Download this zip file
  • unzip the contents in the Oxygene MSBuild folder, on my system it is located at "C:\Program Files (x86)\MSBuild\RemObjects Software\Oxygene"
  • Instead of setting the "Framework Folder" option in the project settings, open the .Oxygene file with a text editor and change this line:
    "<Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.targets" />"
    to this:
    "<Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.CompactFramework.targets" />".
    It is located at the end of the file.
  • In the project folder (same folder as the .Oxygene file is located) create a text file called "CFFolder.txt"
    In this file you can put the path to the Compact Framework folder.
    e.g. C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE
  • From this point on you can follow the directions from the video for developing CF apps.

No comments:

Post a Comment