如何管理.net版本以获取完整的解决方案 [英] How to manage .net versions for a complete solution

查看:51
本文介绍了如何管理.net版本以获取完整的解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用VS2010,并且具有为多个.net框架编写的多个c#库"(源代码).所有这些库都受Subversion的版本控制.今天,我将此库添加到项目解决方案中,为每个库选择正确的.net框架,并添加一个定义的"dotNetVersion3_5".如果我将这些库提交到Subversion,然后在另一个项目中检出它们,而这仅适用于.net 2.0,则必须手动再次进行所有这些更改.
有机会:
a)为项目解决方案定义.net版本
b)为项目解决方案定义一个定义"
在VS2010中?
Thx Peter

Hi,
I use VS2010 and have several c# "libraries" (source code) which are written for several .net frameworks. All of this libraries are under version control with subversion. Today I add this libraries to a project solution, select the right .net framework for each library and add a define "dotNetVersion3_5" for example. If I commit this libraries to subversion, and checked them out at another project whis is only for .net 2.0 I have to make all these changes again by hand.
Is there any chance to:
a) Define a .net version for a project solution
b) Define a "define" for a project solution
In VS2010 ?
Thx Peter

推荐答案



不知道这对您来说是否可行,但我曾经使用以下想法解决了类似的问题:
-包含的库仅供参考,不作为源代码项目
-每个库都有不同的编译输出(使用不同的项目),例如,每个目标框架都有一个.所有二进制文件都转到了不同的bin文件夹中
-实际项目的所有引用都指向一个目录,例如C:\ CurrentLibraries
-有一个小的CMD文件,它将所需的库版本从其原始输出文件夹复制到C:\ CurrentLibraries

这样,我可以轻松地将C:\ CurrentLibraries文件夹中的实际dll更改为所需的任何版本,而无需修改引用或库项目.更改库源代码后,所有必需的项目都使用单独的cmd文件再次构建,因此无需分别编译每个库项目.

这是几年前的事,所以不知道这些工具当前是否提供更优雅的方式来执行此操作,但这是当时的最佳解决方案.

问候,

mika
Hi,

Don''t know if this is a feasible solution for you but I once resolved a similar problem using following ideas:
- libraries are included as references, not as source code projects
- each library had different compile outputs (using different projects), for example one for each target framework. All the binaries went to different bin folders
- all the references for the actual project were pointing to a single directory, for example C:\CurrentLibraries
- had a small CMD file which copied the desired library versions from their original output folders to C:\CurrentLibraries

This way I could easily change the actual dll''s in the C:\CurrentLibraries folder to whatever versions I needed without making modifications to the references nor to the library projects. When a library source code was changed all the necessary projects were built using again a separate cmd file so each library project didn''t need to be compiled separately.

This was years ago so don''t know if the tools currently provide more elegant ways to do this but this was the best solution at that time.

Regards,

mika


这篇关于如何管理.net版本以获取完整的解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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