开发者

Switch compilation between compact and full .net framework?

Does anyone know how to switch a compilation of a library 开发者_JS百科project on visual studio, so I can compile for compact framework and full .Net framework?


You can use two project-files on the shared sources.

So, you may have one solution file and two project on it at the same directory.


If you make a .NET CF library it will in most cases also run on the desktop .NET.

You can even make this kind of development a bit easier by following the steps described here. The link will help you set up Visual Studio so that you can compile for .NET CF but deploy to your desktop.


I'm pretty sure it appears in your project properties if you have the compact framework installed (just like the choice between versions 2.0-3.5).


We've looked at making one project compile for both full and compact framework vesrions but in the end it was messy (lots of hacking project files) and we routinely encountered sceneraios where we wanted to include certain files or references in one or the other targets (such as including Smart Device Framework in the compact framework version).

We had solution-related problems when performing test analysis of MSTest unit tests so we now have two separate solutions. Each solution has a tree of mostly the same logical projects - one for compact framework and the other for full framework. It's a bit of maintenance but it has worked reasonably well.

One additional item we needed to manually add to either the full or compact framework project was changing the default intermediate \output path to avoid the project outputs from stepping on each other:

<Project ... >
  <PropertyGroup>
    <BaseIntermediateOutputPath>objCE\</BaseIntermediateOutputPath>
...

Open the .csproj file and add the line to the first <PropertyGroup> element.

More information on the parameter can be found here: http://msdn.microsoft.com/en-us/library/bb629394.aspx

One thing to note is that you will get a security warning when you open the project stating that it has been customized. You can select to load it normally and uncheck the ask me every time option to never see it again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜