我应该如何编译为净3.5和4个在同一时间一个项目 [英] How do I compile a project for both .Net 3.5 and 4 at the same time

查看:116
本文介绍了我应该如何编译为净3.5和4个在同一时间一个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编译为净3.5和.NET 4.0中的一个项目。什么是这样做的最低摩擦的方式?如果我引用这个项目从另一个程序集,我怎么确定哪些运行时被如何定位?或者我应该只是直接引用二进制文件?

I need to compile a project for both .Net 3.5 and .Net 4.0. What is the most low-friction way of doing this? If I reference this project from another assembly, how do I determine which runtime is being targeted? Or should I just reference binaries directly?

推荐答案

我这样做,只需有两个的csproj文件。然后,我可以很容易地设置版本,参考文献,内置符号等。为了避免维护文件列表中的两个,我用毯子包括 - 即

I do this simply by having two csproj files. Then I can set the version, references, build-symbols, etc easily. To avoid having to maintain the file list in both, I use a blanket include - i.e.

我(在第二的.csproj):

I have (in the secondary .csproj):

<Compile Include="..\TheMainProject\**\*.cs" />

这表示编译所有的.cs文件中的,并在的.. \ TheMainProject。

This says "compile all .cs files in and under ..\TheMainProject".

这篇关于我应该如何编译为净3.5和4个在同一时间一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆