如何在 C# 部署中包含文件? (How can I include files in a C# deployment?)


問題描述

如何在 C# 部署中包含文件? (How can I include files in a C# deployment?)

I have a DLL I need to deploy with my C# application. It's not currently included in the installation package when I hit "Publish" so how do I include it?

Would the process be any different if I had app.config and other files I wanted to deploy with my application?


參考解法

方法 1:

If it's referenced it should be included automatically. I've deployed a couple of apps that require a 3rd party dll and they've published OK.

Is the dll referenced correctly in your project? That's the only thing I can think of at the moment that might be the problem, but if it wasn't your code wouldn't compile and/or link anyway.

To get the xls file to deploy all you need to do is add the file to the solution and then set the "Copy to Output Directory" property on the file.

方法 2:

I take it you are using Visual Studio? 

If your using Visual Studio 2008 (I have no experience with Visual Studio 2005) under the Publish tab in your project properties click on the Application Files button. This will bring up a list of all dependencies assembalies required by your project. If you find that required dll is not being published by the Visual Studio publisher tool by default you can go into here and set the Publish Status of the offending dll to Include.

Sometimes in my more complicated projects, depending on the type of dependency, I have to go into this menu and force certain dll's to be included opposed to the default Prerequsite setting.

...but this is all under the assumption you have the assembly properly referenced in the required projects and everything is compiling fine.

方法 3:

Can't you add the dll as a resource to your installer project?

(by Adam DavisChrisFMatthew RustonAndrew Siemer)

參考文件

  1. How can I include files in a C# deployment? (CC BY-SA 3.0/4.0)

#installation #publish #deployment #C#






相關問題

Instal versi Firebird yang benar (32bit atau 64bit) dengan Inno Setup (Install correct version of Firebird (32bit or 64bit) with Inno Setup)

在 Ubuntu 中與 EPD python 一起安裝 NLTK (Installing NLTK alongside EPD python in Ubuntu)

INSTAL_PARSE_FAILED_NO_CERTIFICATES - 試圖在 robotsium 上測試不是我的 .apk 文件 (INSTAL_PARSE_FAILED_NO_CERTIFICATES - trying to test not my .apk file on robotium)

直截了當的回答:安裝 py2app (Straight and simple answer: installing py2app)

Sql 2008 排序規則 (Sql 2008 Collation)

Apache Ant Build 命令“拒絕訪問” (Apache Ant Build command "Access Denied")

如何在 C# 部署中包含文件? (How can I include files in a C# deployment?)

使用一個安裝程序安裝多個軟件(安裝包裝器?) (Install multiple softwares with one installer (install wrapper?))

如何獲取 Eclipse 安裝目錄的絕對路徑? (How can I get the absolute path to the Eclipse install directory?)

iPhone,如何使用objective-c為iphone安裝新字體? (Iphone,how to install new font to iphone by using objective-c?)

create-react-app 命令卡在使用 cra-template 安裝 react react-dom react-scripts (create-react-app command stuck on installing react react-dom react-scripts with cra-template)

tensorflow安裝報錯(ERROR:找不到滿足tensorflow要求的版本) (Tensorflow installation error (ERROR: Could not find a version that satisfies the requirement tensorflow))







留言討論