PC Review


Reply
Thread Tools Rate Thread

Class Library in CF vs Windows Class Library

 
 
TechGladiator
Guest
Posts: n/a
 
      25th Jan 2006
I have a bunch of code in classes that I am trying to convert into a
class Library. What I would like to do it use the same code in my CF
Class library as well as my WindowsCF class library.

My problem is that most of my classes have an Import for
System.Data.SqlClient since I use the SQLConnection method/property.
It works fine if I compile it as a Windows Class library but when I do
it for CF it tells me that SQLConnection is not defined.. I dont
really want to go to every file in my project and change the imports or
keep two different copies of the code since it will be a pain to
maintain.

Isnt there a way to share the same code for a Windows Class library as
well as a CD class library and maybe just have to have a different
imports file depending on which project you are compiling?

Thanks
Mike

 
Reply With Quote
 
 
 
 
tamberg
Guest
Posts: n/a
 
      25th Jan 2006
If the library (i.e. your assembly) depends on a ".NET only" assembly
it is not portable.

 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      25th Jan 2006
You can share the bits that are relevant. The non-relevant bits can be
conditionally compiled out:
http://www.danielmoth.com/Blog/2004/...lframe_17.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

"TechGladiator" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a bunch of code in classes that I am trying to convert into a
> class Library. What I would like to do it use the same code in my CF
> Class library as well as my WindowsCF class library.
>
> My problem is that most of my classes have an Import for
> System.Data.SqlClient since I use the SQLConnection method/property.
> It works fine if I compile it as a Windows Class library but when I do
> it for CF it tells me that SQLConnection is not defined.. I dont
> really want to go to every file in my project and change the imports or
> keep two different copies of the code since it will be a pain to
> maintain.
>
> Isnt there a way to share the same code for a Windows Class library as
> well as a CD class library and maybe just have to have a different
> imports file depending on which project you are compiling?
>
> Thanks
> Mike
>



 
Reply With Quote
 
TechGladiator
Guest
Posts: n/a
 
      27th Jan 2006
Daniel,

Thats EXACTLY what I was looking for.

Thanks
Mike

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enterprise Library - Class Library Greif. =?Utf-8?B?QUo=?= Microsoft ASP .NET 7 6th Dec 2007 09:33 AM
Class Library Versus Control Library Darren Microsoft Dot NET Compact Framework 2 23rd Apr 2007 02:27 AM
Basic How To Question: Class Library or Windows Control Library eBob.com Microsoft VB .NET 3 20th Feb 2006 08:12 PM
Re: Difference between Web Control Library and Class Library Alan Ferrandiz [MCT] Microsoft ASP .NET 0 11th Sep 2004 02:51 PM
Big Faceless PDF Library 2.2.3 - A Java class library for importing and creating PDF documents. Gordon Darling Freeware 0 13th Jul 2004 09:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:18 AM.