如何使C#表单应用程序可移植? [英] How to make c# form application portable ?

查看:87
本文介绍了如何使C#表单应用程序可移植?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在使用VS 2008 EXPRESS版本在C#中做一个项目...现在我正处于使用ACCESS 2007数据库进行部署的阶段,我已经使用C#发布向导创建了安装文件,但是我得到的安装文件的格式不是什么我想要...

通过发布向导生成的安装文件的主要限制之一(对我而言)是它需要满足一些先决条件,即-1)Window installer 3.1或更高版本2)Dot net framework 3.5或更高版本....

因此,为了克服此限制,我认为通过在单个程序包中包含所有依赖的dll和其他资源来制作应用程序的便携式版本,以便它可以通过复制而在任何Windows机器中运行(同样,我们为运行其他便携式应用程序所做的操作)...

我是手动部署应用程序的新手,我只是想从此应用程序开始...

我会非常感激..如果我能得到一些建议的话…….为了使我的C#应用​​程序具有可移植性...
在此先感谢所有回复此帖子的人……

解决方案

您的可移植性要求仅适用于.NET Framework v.3.5和v.4.0. .您不会有任何可移植性问题.对于Access,它应作为先决条件列出,作为项目在.NET Framework之外使用的所有其他软件.出于很多原因,将Access和其他产品的安装留给客户确实是一个好主意.您只需要将目标.NET版本保持在v.3.5,然后再迁移到Visual Studio 2010(或更高版本).如果您使用Visual Studio 2008,则默认情况下会完成.

相反,.NET Framework可重新分发本身可以很容易地与您的应用程序一起部署,请参见 http://msdn.microsoft.com/en-us/library/6hbb4k3e.aspx [ ^ ].

—SA


您不能单独使用任何基于C#(或其他.NET语言)的应用程序:您将始终需要某些版本的.NET框架.在您的情况下,您已经开发了可与.NET V3.5一起运行的软件,因此安装程序应进行检查,并希望(如果没有)安装它.同样,需要Windows installer 3.1才能使安装程序正常工作.

但是,这些在现实世界中通常不会出现问题:无论如何,安装程序都会自动安装在现代OS上,并且Vista包括.NET 2.0,Windows 7包括.NET 3.5

如果这是一个实际问题,可能值得将您的应用程序降级为.NET V2.0(因为它将在没有其他软件的情况下安装在vista及更高版本上),但实际上,这可能需要对应用程序进行太多更改才能使之值得. /blockquote>

Hi frens,
i am doing a project in C# using VS 2008 EXPRESS edition... Now i m in the stage of deploying it with ACCESS 2007 database, i have created setup file using C# publish wizard but the setup file that i get is not in the form what i wanted...

One of the major limitation(For me) of the setup file thus generated via publish wizard is that it need some prequisites that must be fulfilled ie- 1) Window installer 3.1 or greater 2) Dot net framework 3.5 or greater ....

So to over come this limitation I think to make portable version of my application by including all depending dll and other resource in a singal package so that it can run in any windows machine simply by copying(just Similarly what we do to run other portable application) ...

I am new in deploying application manually, and i just wanted to start... from this application...

I would be very thankful.. if i get some fruit full suggestion....... For making my c# application portable...

Thanks in advance to all of you who reply to this post......

解决方案

Your portability requirements only cover .NET Framework v.3.5 and v.4.0. You won''t have any portability problems. As to Access, it should be listed in prerequisites as all other software used by your project beyond .NET Framework. This is really a good idea to leave installation of Access and other products to the customer, by many reasons. All you need is keeping the target .NET version to v.3.5 after you migrate to Visual Studio 2010 (or later, in future). If you use Visual Studio 2008, it will be done by default.

In contrast, the .NET Framework re-distributable itself can easily be deployed with your application, see http://msdn.microsoft.com/en-us/library/6hbb4k3e.aspx[^].

—SA


You can''t make any C# (or other .NET language) based application stand alone: you will always need some version of the .NET framework. In your case, you have developed it to run with .NET V3.5 so your installer should check for that, and will (hopefully) install it if it isn''t present. Equally, Windows installer 3.1 is required to make the installation program work.

However, these aren''t normally problems in the real world: the installer is installed automatically on modern OS''s anyway, and Vista included .NET 2.0, Windows 7 includes .NET 3.5

It may be worth downgrading your app to .NET V2.0 if this is a real problem (as it will install on vista and above without additional software) but in practice this may required too many changes to your application to be worth while.


这篇关于如何使C#表单应用程序可移植?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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