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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.