简体   繁体   English

如何使 C# winform 应用程序可移植

[英]How to make C# winform application portable

I have developed a winform application with C# 4.5.我用 C# 4.5 开发了一个 winform 应用程序。 I want to make it portable.我想让它便携。 I meant that it should not need to be installed.我的意思是不需要安装它。 To deploy this application I would like to just copy and paste the folder of application file.要部署此应用程序,我只想复制并粘贴应用程序文件的文件夹。 Like Tally or VLC Media player.像 Tally 或 VLC 媒体播放器。

The environment and dependencies are as follows环境和依赖如下

C# Winform C# Winform

.Net Framework 4.5 .Net 框架 4.5

SQLite SQLite

Microsoft Report Viewer微软报告查看器

Please suggest a way how to do it.请提出一种方法来做到这一点。

For each of your project's references, you should verify Copy Local property is set to True .对于您项目的每个引用,您应该验证Copy Local属性设置为True This way, all the references will be copied in your project's bin folder (at compile time).这样,所有引用都将复制到项目的bin文件夹中(在编译时)。

This should be suficient for a copy/paste deployment of your bin folder.这对于bin文件夹的复制/粘贴部署应该足够了。

Keep in mind,记住,

no program is an island -- Don Box没有程序是一座孤岛——唐·博克斯

so deployment machines should need at least target framework installed.所以部署机器应该至少需要安装目标框架。

.NET Framework will first search inside bin folder and if reference is not found, it will search the GAC (Global Assembly Cache). .NET Framework 将首先在bin文件夹中搜索,如果未找到引用,它将搜索 GAC(全局程序集缓存)。

XCopy 部署可用于部署您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM