2012-04-23 71 views
1

我想部署我的C#.Net控制檯應用程序。部署C#.Net控制檯應用程序

我試過的方法。

構建

  1. 轉到目錄
  2. 調試目錄複製文件,並移動到壓縮文件夾
  3. 在不同的機器上提取並運行的.exe文件的應用程序

問題我是h aving是:

我已經在我的項目中使用了MSXML2程序集。 我猜這個程序集沒有複製到bin目錄,我正在運行的機器.exe文件沒有這個程序集。

當我運行.exe它會得到低於錯誤。

System.IO.FileNotFoundException: The system cannot locate the resource specified. 
at MSXML2.IXMLHTTPRequest.send(object varbody 
at projectname.Program.Main(String[] args)) 

我該如何確保將此程序集正確加載到我已部署的文件夾中。

感謝您關注我的問題。

應用dotnetengineer suggession 設置複製本地爲TRUE 新問題:

Could not load file or assembly 'Interop.MSXML2, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. 
+0

爲什麼要部署調試版本而不是發行版本? – 2012-04-23 15:20:34

+0

沒關係。與發佈版本相同。 – HaBo 2012-04-23 15:27:00

回答

0

點擊並選中Soultion Explorer中引用MSXML2。在「屬性」窗格中,確保「複製本地」設置爲「True」。

+0

Interop.MSXML2此屬性已禁用。我無法改變它的真實。只有我可以改變這是「EmbedInterop類型」和「隔離」 – HaBo 2012-04-23 15:14:04

+1

請參閱此StackExchange問​​題和答案:http://stackoverflow.com/questions/3635716/visual-studio-copy-dll-refrences-to-output-文件夾 – dotnetengineer 2012-04-23 15:19:00

+0

正在進一步移動,但給出新的例外。請使用新的例外 – HaBo 2012-04-23 15:31:10