Share classes / projects between frameworks

  • Thread starter Thread starter eschneider
  • Start date Start date
E

eschneider

Is there a way to easily Share classes / projects between frameworks? say
reg windows and win ce/pocket pc?



Thanks,

Schneider
 
Hi Schneider,

A desktop assembly cannot execute on the device, but the reverse is
possible. If you create a smart device project and build it, the output
(the EXE or DLL) can be executed on the desktop and can be referenced by
desktop projects.

This works because the .NET Compact Framework assemblies are retargetable.
If you open one of them with ILDASM, you can observe that they have the
System.Reflection.AssemblyNameFlags.Retargetable attribute. This means that
at run time all references to the .NET Compact Framework assemblies are
retargeted to the desktop equivalents. So, to be clear, your assembly uses
the desktop implementation, not the device implementation of the .NET
Framework.

Note that the .NET Compact Framework is not a strict subset of the .NET
Framework; it actually adds some members of its own. There are four
device-specific assemblies: System.Data.SqlServerCe, System.Net.IrDA,
Microsoft.WindowsMobile.DirectX and Microsoft.WindowsCE.Forms.

If an assembly built with the .NET Compact Framework uses a device-specific
type, when it is executed on desktop, an exception will be thrown.

For more information about sharing code between full .NET Framework and
Compact Framework, please refer to the following article:

"Write Code Once For Both Mobile And Desktop Apps"
http://msdn.microsoft.com/en-us/magazine/cc163387.aspx

Hope this helps.
If you have any other question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Yes, I have ran PPC apps on the desktops before, thought it's not as nice as
a full Windows app.

In my case it's a set of custom windows controls, which in theory should
work on CE, PPC, ...
I do have the controls logically separated also, Abstract Interfaces,
Business logic, Rendering logic, and testing application, so I would think
it should be easier to convert.

Schneider
 
Back
Top