我们可以在VS 2005中运行VS 2008 Project吗 [英] can we run VS 2008 Project in VS 2005

查看:66
本文介绍了我们可以在VS 2005中运行VS 2008 Project吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在Visual Studio 2008上开发Windows应用程序.如果我可以运行此项目,请
在Visual Studio 2005上运行?

谢谢,
Balu

Hi,

I am developing a windows application on Visual Studio 2008.if i can run this project
on Visual Studio 2005?

Thanks,
Balu

推荐答案

没有针对项目的运行"概念.您可以运行从项目构建中获得的应用程序,但是可以与Visual Studio完全无关.应用程序的兼容性取决于其目标平台版本,CPU指令集体系结构以及用于加载该平台的平台:已安装的.NET Framework版本和CPU.

否,您无法使用VS 2005打开VS 2008项目.

您只能尝试使用原始项目作为示例将项目重新创建为VS 2005项目.有降级转换工具,您可以在CodeProject文章中找到一些转换工具.但是,它可能成功也可能不会成功,因为1)2008年的项目可以使用支持C#2.0的VS 2005不支持的C#3功能; 2)2008年的项目可以使用VS 2005不支持的.NET Framework 3.5功能,该功能仅针对v.2.0.您可以尝试查看编译错误并找到一些解决方法...

从所有实际的角度来看,在某些情况下,这种解决方法都是不可能的.例如,如果原始项目使用WPF,您几乎无能为力. :-)

—SA
There is no such concept as "run" for projects. You can run the application obtained from the project build, but it has nothing to do with Visual Studio at all. The compatibility of an application depends on its target platform version, and CPU instruction-set architecture and the platform used to load it: installed .NET Framework version and CPU.

No, you cannot open VS 2008 project with VS 2005.

You can only try to re-create a project as a VS 2005 project using original project as a sample. There are downgrade conversion tools, you can find some in CodeProject articles. However, it may or may not be successful because 1) a 2008 project can use C# 3 features not supported by VS 2005 which supports C# 2.0; 2) a 2008 project can use .NET Framework 3.5 features not supported by VS 2005 which is targeted to v.2.0 only. You can try to see compilation errors and find some work-around…

In some cases such work-around will be impossible from all practical points of view. For example, you hardly can do much if original project uses WPF. :-)

—SA


C#和.NET可能是世界上最专业的程序员之一,《深度C#》的作者Jon Skeet,( imho是技术写作的杰作")在这里讨论了类似的情况,用户想要在VS 2008中打开VS 2010项目:[ ^ ].

到目前为止,Visual Studio在各个版本之间都向后兼容:例如,您可以在VS 2008中打开VS 2005解决方案,并且当在较新的VS中打开在较旧的VS中创建的解决方案时,会启动自动转换器.负责调整项目结构,报告不兼容错误等.

但是,如果您在VS 2005中启动相同类型(WinForm,Wpf)的新解决方案/项目,并从VS 2008解决方案中导入项目文件,则在以下情况下,您可能会打开VS 2008解决方案并使用摆弄一些:

1.请勿在VS 2008中移至"bin"或"object"文件夹.(明显,呵呵)

2. VS 2008中的解决方案应设置为可以在VS 2005中进行编译的FrameWork版本进行编译.

3. VS 2008解决方案中的代码必须不使用VS 2005支持的功能而不使用FrameWork的任何新功能.

但是,您可以执行此操作并不意味着您应该执行此操作!
One of the world''s possibly most expert programmers in C# and .NET, Jon Skeet, the author of "C# in Depth," (imho a "masterpiece" of technical writing) discusses a similar situation here, where a user wants to open a VS 2010 project in VS 2008:[^].

Visual Studio has been, so far, backwards compatible between versions: you can open a VS 2005 solution in VS 2008, for example, and there have been automatic converters that start-up when opening a solution created in an older VS in a newer one that take care of adjusting project structure, report incompatibility errors, etc.

However, if you start a new solution/project in VS 2005 of the same type (WinForm, Wpf), and import the project files from the VS 2008 solution, under the following conditions you may get the VS 2008 solution to open and build with some fiddling:

1. don''t move over the ''bin or ''object folders from the VS 2008. (obvious, huh)

2. the solution in VS 2008 should have been set to compile against the FrameWork version you can compile against in VS 2005.

3.the code in the VS 2008 solution must make no use of any newer features of the FrameWork than those supported by VS 2005.

However, the fact you could do this, doesn''t mean you should do this !


这篇关于我们可以在VS 2005中运行VS 2008 Project吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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