Mirek said:
Im writing .NET libraries for .NET Framework and .NET Compact
Framework too. What is the best practices to write 'multi-platform
(.NET Framwork / .NET Compact Framework)' libraries
(Which attribute says; in my class; that this member of a class is
.NET Compact Framework compatible)
I'm not familiar with such an attribute. The thing is that for .NET it
doesn't matter if you're compiling for the compact framework or normal
..NET, as you're using the same compiler, you just link with another
mscorlib and framework assemblies
In general, everything remoting related should be avoided. Also,
things like:
myStringBuilder.AppendFormat("..."... )
should become:
myStringBuilder.AppendFormat(null, "...
but that's mostly it. To get my o/r mapper core running on the CF.NET
framework I wrote a couple of dummy classes which do nothing on the
CF.NET and I simply add that set of classes to the code when I'm
compiling against the CF.NET. This then helps me avoid to add a lot of
conditional compilation statements in the code and I can keep
[Serializable()] etc. in my code.
So I'd invest some time in that set of classes, which isn't that hard,
and then just develop for the normal .net framework. Porting the code
over would then be a piece of cake
Frans
--
------------------------------------------------------------------------
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#)