Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create a DLL compatible with both standard .NET Framework and .NET Compact Framework?

I'd like certain data functionality to be shared between my .NET desktop application and .NET CF app.

Is it possible to create a universal library accessible by both versions of the application or I need to create two separate DLL's?

like image 249
SharpAffair Avatar asked May 22 '12 17:05

SharpAffair


1 Answers

Yes--the desktop .NET runtime knows how to load and run .NET CF DLLs, so your first step would be to build your library for the Compact Framework.

You'll find that from time to time you'll want to use features of the Desktop framework, and you can pull those in using reflection.

Here's a very through intro to the process in MSDN Magazine.

NOTE: If it's possible for your mobile and desktop versions to share code but not the .dll specifically, then you'll have an easier time building this and staying happy if you use conditional compilation instead.

like image 189
sblom Avatar answered Oct 16 '22 10:10

sblom