Re: VS won't allow sharing CF and desktop projects with each others' solutions

From: Peter Foot (feedback_at_no-spam.inthehand.com)
Date: 09/03/04


Date: Fri, 3 Sep 2004 16:19:47 +0100

You can add a reference to a Compact Framework compiled dll to a desktop
project, but not the reverse. As you've already discovered you can't share
the project in both solutions, but you can reference the device dll in your
desktop project. The only caveats to this are that your device dll must not
reference any device specific functionality such as SqlCe, System.Net.IrDa,
Microsoft.WindowsCE.Forms etc.

Peter

-- 
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org
Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups?  Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
"Rik Hemsley" <rik@safeware.co.uk> wrote in message 
news:%23CGmHZckEHA.1152@TK2MSFTNGP11.phx.gbl...
> I've seen (thanks to google groups) that it's possible to share code 
> between projects which target different .NET frameworks, by linking code 
> files.
>
> I'd like to share an entire class library project, which is framework- 
> independent, between two solutions, one targetting the CF and one the 
> desktop.
>
> My problem is that VS.NET 2003 won't allow me to share projects.
>
> If I load up my desktop-targetting solution and try to add a class library 
> project which I specified (at creation) would target the CF, VS says 'The 
> operation could not be completed'.
>
> If I load up my CF-targetting solution and try to add a class library 
> project which I specified would target the desktop framework, VS says that 
> the VB.NET compiler could not be created and that all projects in a VB 
> solution must target the same platform.
>
> If it's not possible to share projects in this way (how are we supposed to 
> write cross-platform applications?) then perhaps it's possible to share 
> DLLs instead.
>
> I tried adding a DLL, created by a desktop project, as a reference of a CF 
> project. VS then warned me that it may not be compatible, then gives two 
> errors looking like this:
>
> Error: The dependency 'mscorlib, Version=1.0.5000.0, Culture=neutral, 
> PublicKeyToken=969db8053d3322ac' in project 'LQGUI' cannot be copied to 
> the run directory because it would conflict with dependency 'mscorlib, 
> Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
>
> And one like this:
>
> The dependency 'System.Design' could not be found.
>
> Does the first error just mean that VS can't cope with me having two .NET 
> frameworks with the same version (but different targets)? If so, is that 
> even fixable?
>
> Is my only option to create new projects and link all source files across?
>
> Cheers,
> Rik 


Relevant Pages

  • Re: PRJ0019: A tool returned an error code from....
    ... Now if I copy the dll itself over to ... When you add a reference in VS2002/2003, ... One useful thing you can do is to have a common output directory for ... a common target directory for all projectfs in a solution. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Changing reference from 1.0 framework dlls to 1.1 framework dll
    ... You'd need VS 2003 to develop apps using references to the 1.1 framework. ... When I removed the reference of existing dll and then ...
    (microsoft.public.dotnet.framework.setup)
  • Re: mixing .NET and .NET Compact DLLs on a PocketPC
    ... > like to port it to the .NET Compact framework though. ... > replace the usual .NET Compact DLL by a full .NET framework DLL ... > after deleting the reference to the Compact .NET version. ...
    (microsoft.public.dotnet.framework)
  • Re: mixing .NET and .NET Compact DLLs on a PocketPC
    ... > like to port it to the .NET Compact framework though. ... > replace the usual .NET Compact DLL by a full .NET framework DLL ... > after deleting the reference to the Compact .NET version. ...
    (microsoft.public.dotnet.framework.compactframework)
  • PRJ0019: A tool returned an error code from....
    ... A tool returned an error code from "Copying assemblies ... to target directory..." ... I got this when I added a reference to a project. ... Now if I copy the dll itself over to ...
    (microsoft.public.dotnet.languages.vc)