How to share common files between .NET and .NET CF assemblies

  • Thread starter Thomas F. Divine [DDK MVP]
  • Start date
T

Thomas F. Divine [DDK MVP]

I have a C# assembly that needs to be built for .NET and for .NET compact
framework. The code files and classes in this assembly are identical except
for a few #if cases that are platform specific.

My problem is really how to setup two .NET projects that use common .cs
files.

If I create the .NET project with all needed files, all is well.

Now if I create teh second .NET CF project and add the file from the first
project to it, then the files are _copied_ into the new project.

I'm hoping to maintain the sources in one project and allow this single set
of sources to be built under two different projects.

I haven't seen a way to do this.

Any thoughts welcome.

Thomas F. Divine
 
C

casey chesnut

i usually create the CF project 1st and create all the files.
also add something like a CF directive for #if'ing later on.
then i create a Desktop class lib project.
then i manually move the desktop project file into the same directory as the
CF project as above.
i delete the directory that the desktop project file was originally created
in.
then i open the desktop project and include the CF files.
this leaves 2 project files in the same directory, sharing the same files.

it would be great if there was a standard directive for CF projects to help
with #if'ing!

Thanks,
casey
http://www.brains-N-brawn.com
 
C

casey chesnut

oh yeah, you might also modify the project to build to different
directories.
so that the CF version builds to \binCF or something like that and .NET
builds to \bin.
might keep you from stepping on your own toes?
casey
 
C

Chris Tacke, eMVP

Take a look at what we did with the OpenNETCF.IO.Serial classes, which
support both CE and the desktop with a single compiled assembly.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top