如何降级c#项目 [英] How to Downgrade a c# project

查看:222
本文介绍了如何降级c#项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,



我开发了一个桌面应用程序,其目标框架是4.0。但我想在3.5或2.0中运行该项目。我在我的项目中将目标框架更改为3.5并且正在运行。但是在安装到另一个系统时,它正在询问框架4.0版本。我无法安装该软件。该机器包含框架3.5。我已经为框架3.5设置了先决条件,然后它也无法正常工作。所以请帮帮我。







谢谢

Sujith

Dear Sir,

I have developed one desktop application,its target framework is 4.0. But i want to run that project in 3.5 or 2.0. I changed target framework to 3.5 in my project and it is running. But at the time of installation in another system it is asking framework 4.0 version. I can not install that software. That machine contain framework 3.5. I have set prerequisites to framework 3.5 then also it is not working. So please help me.



Thank You
Sujith

推荐答案

更改框架版本(在项目属性目标框架下拉列表中)并且已关闭并重新加载后,必须重建整个项目。如果你不是,那么你的exe将继续期待旧的更高版本。您必须为解决方案中的每个项目设置适当的框架版本(包括我认为的任何安装项目),并确保任何外部控件/ dll适用于较低的框架版本。

不要忘记重建项目的Debug和Release版本,或者您可能正在安装比您想象的旧版本! :笑:
After you change your framework version (in the Project Properties Target Framework drop down) and it has been closed and reloaded, you must rebuild your entire project. If you don''t, then your exe will remain expecting the "old", higher version. You must set the appropriate framework version for each project in your solution (including any setup project I believe) and also ensure that any external controls / dlls are suitable for the lower framework version.
Do not forget to rebuild both the Debug and Release versions of your project, or you could be installing an older version than you think! :laugh:


从你的问题我可以看出你了解所涉及的所有内容,你只需要进行逻辑演绎。您可以使用Visual Studio 2010来支持从2.0到4.0的任何目标平台,并且运行时将需要在目标计算机上或之后的相应版本的.NET Framework。



除此之外,您应该了解库是从早期版本到更高版本添加和升级的,并且在较新版本中不推荐使用某些API。降级时,构建过程会清楚地检测到它:如果您尝试使用较旧库中不可用的某些较新功能,则编译将失败。如果您升级并面对不推荐使用的功能,通常的编译器诊断将是警告。



您将需要处理那些构建失败和警告,没有其他办法。有些项目可以为你需要的所有目标平台建立共同点,有些项目不可以。



根据你的一般信息,那个'所有你应该考虑的。



-SA
From your question I can see that you understand all what''s involved, you only need to do logical deductions. You can use Visual Studio 2010 to support any target platforms from 2.0 to 4.0, and the run-time will requires respective version of .NET Framework on the target machine, or later.

On top of this, you should understand that the libraries are being added and upgraded from earlier to later versions, and some part of API is deprecated in newer versions. It will be clearly detected by the build process when you downgrade: compilation will fail if you are trying to use some newer feature not available in older library. If you upgrade and face with deprecated feature, the usual compiler diagnostics will be the warning.

You will need to deal with those build failures and warnings, there is no other way. Some projects can be brought to the common denominator to be built for all target platforms you need, some can''t.

Based on your very general information, that''s all you should take into account.

—SA


流responseStream = webResponse。 GetResponseStream();

MemoryStream memoryStream = new MemoryStream();

responseStream.CopyTo(memoryStream);
Stream responseStream = webResponse.GetResponseStream();
MemoryStream memoryStream = new MemoryStream();
responseStream.CopyTo(memoryStream);


这篇关于如何降级c#项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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