Full .NET Framework Compatibility

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is it possible to have the same source code compiling for both .NET compact
framework and full framework?? I.e, is it possible to have an application
that can be ran both in a desktop machine and in a Handheld device (2
separate executables, off course)?

If this topic has already been commented, could you please provide me the
link to the discussion?

Thanks in advance.
 
You can share source code between a desktop project and a device project
using the linking feature that can be found when you add a file to a
project. So instead of clicking the button that says "Open" when adding an
existing file, click the dropdown arrow on the button and select "Link
File". But the common denominator is usually your device code. So if you
author your code and compile it against the CF then, unless you have used
types specific to the CF or PInvoked to a dll that will not exist on the
desktop, you should be able to reuse the source in a desktop project. And if
you really want to reuse the binaries you can, but I wouldn't recommend it.
Applications compiled against the CF are retargetable to the desktop.
Meaning that you can run your exe on the desktop even though it has been
compiled against the CF. There are of course restrictions to this as pointed
out previously, however it is possible. But, at this point, source sharing,
IMO, is a good way to leverage the same logic on both the device side and
the desktop side. Another option is to use web services to access a common
code base, but this requires you to have a connected environment.
 
Back
Top