I have a C# project in VS2008 which I wish to build for two targets – x86 and the compact framework for dot net (CF.Net) depending on a chosen configuration (say Debug/SmartDeviceDebug etc). How do I go about this? I have an inkling this can be done somehow using the command line and msbuild but I am interested in a solution which works from within VS2008.
Please note for the time being I am using two different projects for the two target types but its a chore to keep the files synchronized between them. Adding files as links also does not help (its not a scalable solution, the names and number of files change too frequently.)
Any and all suggestions will be appreciated.
I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; for example, you can use wildcards in the csproj. I use this in protobuf-net, which builds on .NET 2.0/3.0/CF 2.0/CF 3.5/Silverlight/Mono – so I know what you mean!
Have a look at my CF 2.0 csproj; in particular:
i.e. find all .cs files at any level in the main project.