請問一個 .Net 2003 安裝專案的問題
各位好,我對這個問題快發瘋了
請救救我
現在我有一個要安裝的project,但是預設的安裝事件不能滿足我的需求
我的需求是在安裝前要測網路的連線,因此我就根據msdn的方法寫了一個dll檔來用
(用C#)
dll裡面如下
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.Net.Sockets;
[RunInstaller(true)]
public class checkPorts: Installer
{
public override void Install(IDictionary stateSaver)
{
TcpClient tc;
try
{
tc = new TcpClient("xxx.com", 80);
}
catch(Exception ex)
{
throw new ApplicationException("連線到xxx失敗!!",ex);
}
tc.Close();
}
}
然後也編譯過了,不過加到安裝程式的自訂動作中的安裝選項,EntryPoint填什麼
都不對,也沒辦法啟用這個dll的功能,不寫的話會是
D:\installer\installer.vdproj 自訂動作 'D:\checkPorts\bin\Debug\checkPorts.dll'
的模組進入點未指定。
寫Install的話會是
D:\installer\installer.vdproj 在自訂動作 'checkPorts.dll' 的模組
'D:\checkPorts\bin\Debug\checkPorts.dll' 中找不到進入點 'Install'
請救救我吧,找google找好久了,謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.209.61
※ 編輯: retsamsu 來自: 140.113.209.61 (08/01 11:24)
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章
14
23