
Signature
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Hello Frans,
I thought, that I can compile my own library, that can be used in both
project ('normal' .NET Framework and Compact .NET Framework). This compiled
library contains objects that I want to use in both projects (like an Order,
or Customer is). But there are helper functions, that can be used only on the
'normal' Framework - like... SendBroadcast or something similar that is
useable only in PC environment.
For example:
Im writing base clases for our business solution like Order, Customer etc.
These object have same structure, same methods, same properties for
Windows-Form apps, .NET.ASP apps, and mobile, PocketPC apps. I would like to
write library, that is useable for both platforms (one library) .. and I
thought, that I can write one library project, and then I have to sign the
methods by an attribute like [CFSupported] or something similar only. Only
the methods, that are supported by CF (because not all methods can be used on
CF)
It seems Im wrong and I have to write two version of my own business
framework. Thats weird.
Thanks for any idea
Mirek.
> > Im writing .NET libraries for .NET Framework and .NET Compact
> > Framework too. What is the best practices to write 'multi-platform
[quoted text clipped - 28 lines]
>
> Frans
Simon Hart - 03 Jul 2006 20:23 GMT
This is not strictly true.
You can write one library that will run on both the Windows CE device and
the desktop by setting the library application as a smart device project.
This is because smart device projects use retargetable assembly references
which can be used on both the CF and the desktop but the opposite is untrue.
You can't compile for desktop and run on CF.
There is no such attribute as [CFSupported]. You have the limitation of the
CF libraries when you compile for both CF and Desktop.
Regards
Simon.
> Hello Frans,
>
[quoted text clipped - 60 lines]
>>
>> Frans
Frans Bouma [C# MVP] - 04 Jul 2006 09:22 GMT
> I thought, that I can compile my own library, that can be used in
> both project ('normal' .NET Framework and Compact .NET Framework).
[quoted text clipped - 3 lines]
> SendBroadcast or something similar that is useable only in PC
> environment.
Oh I have that too. If the methods are inside classes also used on the
CF.NET framework, I mark them with:
#if !CF
//...
#endif
And with the CF builds I pass 'CF' to the compiler, so that code gets
excluded. If the class itself isn't used on CF, I don't include it in
the build. I use own buildscripts with nmake but this also works with
msbuild of course.
> For example:
>
[quoted text clipped - 9 lines]
> It seems Im wrong and I have to write two version of my own business
> framework. Thats weird.
No you don't have to :) Please re-read my previous post, I probably
didn't explain it well enough, but you should just write your code for
normal .net and create some dummy classes for the cf.net code so it's
compilable, and exclude some routines here and there.
Frans
> Thanks for any idea
>
[quoted text clipped - 31 lines]
> > hard, and then just develop for the normal .net framework. Porting
> > the code over would then be a piece of cake :)

Signature
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------