I have one CF solution and one .net framework solution (win32). I'd like to
add a project (the same) to both of the solutions. Some of the code lines
has to be run depending on the platform. I've copied code between projects
before and defined a pre compiler variable for this
#define WIN32
But if the solutions are gonna use the same project (not copying code)
that'll be a problem... Is there a way to workaround this? Is it possible to
define a variable at solution level?
Regards
/Peter Bladh
#if DESKTOP
Console.WriteLine("On Desktop!");
#else
Console.WriteLine("On Device!");
#endif
"Peter Bladh" <peter...@danahermotion.se> wrote in message
news:OL598yW6...@TK2MSFTNGP09.phx.gbl...
I also have antother related problem. I use a third party component,
Xceed.Zip, and when run on CF I have to set a reference to a different dll
than in the win32 application. How do I do that if I'm gonna share a project
between environments?
/Peter Bladh
"Ed Kaim [MSFT]" <edk...@online.microsoft.com> wrote in message
news:uGxfwrX6...@TK2MSFTNGP09.phx.gbl...
The easiest way to do this is to create a new library project, but then
delete the initial .cs file. Close the project and copy the .csproj to the
main library's directory. Open the project and add all the files to it so it
reflects the original project. Now you'll have a directory with all the
source files, including a desktop project file and a device project file.
Developers can work from either project, and their changes will show up in
the other (because it's actually the same set of source files).
The downside to this method is that it requires developers to keep both
projects up-to-date when they add or delete a file.
I'm sorry I don't have a better solution, but I hope this works for you. It
works well for me, but I usually work on small projects at a recreational
level, so your mileage may vary. Maybe someone else has a better solution.
"Peter Bladh" <peter...@danahermotion.se> wrote in message
news:%23LSmPeZ...@TK2MSFTNGP09.phx.gbl...
"Ed Kaim [MSFT]" <edk...@online.microsoft.com> wrote in message
news:OFVmIsG7...@TK2MSFTNGP11.phx.gbl...
#if (DEBUG && !COMPACT)
#warning Net.Framework Desktop (Debug) is defined
#elif (!DEBUG && !COMPACT)
#warning Net.Framework Desktop (Release) is defined
#elif (DEBUG && COMPACT)
#warning Net.Framework.Compact (Debug) is defined
#else
#warning Net.Framework.Compact (Release) is defined
#endif
With this you can use the #else saving the second #if
#if (!COMPACT)
#if (ODBC)
#warning Reference to Microsoft.Data.Odbc.dll needed
using Microsoft.Data.Odbc;
#endif
#warning Reference to Interop.ADOX.dll needed
using System.Data.OleDb;
using System.Data.SqlClient;
#else
using System.Data.SqlServerCe;
#endif
Mark Johnson, Berlin Germany
mj1...@mj10777.de
"Ed Kaim [MSFT]" <edk...@online.microsoft.com> schrieb im Newsbeitrag
news:OFVmIsG7...@TK2MSFTNGP11.phx.gbl...
/peter
"Ed Kaim [MSFT]" <edk...@online.microsoft.com> wrote in message
news:OFVmIsG7...@TK2MSFTNGP11.phx.gbl...