Discussion:
關於跨電腦的共用專案
(时间太久无法回复)
Eric
2006-09-06 04:33:02 UTC
Permalink
請問,
我寫了一個共用專案Util,
打算讓其他電腦上的專案引用,
我在近端電腦的某個專案,
從[加入參考]的地方引用遠端電腦上的Util.dll,
然後在該dll屬性中的[複製本機]設為false,
因為我不希望每台電腦上的專案,
在設計階段就把當下的Util.dll複製到本機,
避免將來更新Util.dll上的困擾,
我是希望能在RunTime時即時引用最新版本,
然後在Web.config填入下列區段:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<codeBase href="http://remote_computert/Util/bin/Util.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>,
近端電腦上的專案,
在設計階段是可以直接引用Util內的函數,
編譯上也沒問題,
可是執行之後,
出現下列錯誤訊息:

'/WebApplication1' 應用程式中發生伺服器錯誤��
--------------------------------------------------------------------------------

找不到檔案或組件名稱 'Util' 或其相依性的其中之一。
描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。

例外詳細資訊: System.IO.FileNotFoundException: 找不到檔案或組件名稱 'Util' 或其相依性的其中之一。

原始程式錯誤:

在執行目前 Web 要求期間,產生無法處理的例外狀況。如需有關例外狀況來源與位置的資訊,可以使用下列的例外狀況堆疊追蹤取得。

組件載入追蹤: 下列資訊在確定為何無法載入組件 'Util' 時是有幫助的。

=== Pre-bind state information ===
LOG: DisplayName = Util, Version=1.0.2438.20906, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/WEB/WebApplication1
LOG: Initial PrivatePath = bin
Calling assembly : WebApplication1, Version=1.0.2440.22006, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: Util, Version=1.0.2438.20906, Culture=neutral,
PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util/Util.DLL.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util.DLL.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util/Util.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util/Util.EXE.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util.EXE.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util/Util.EXE.

不知道如何才能在RunTime時即時引用遠端電腦上的組件,
請各位先進指教,
謝謝!!

Eric
璉璉
2006-09-06 05:39:55 UTC
Permalink
°£€F Web °ÑŠÒ¥~¡AASP.NET šÃšSŠ³€äŽ©»·ºÝ°ÑŠÒ¡C
ŠÛ°Ê°ÑŠÒ«h¶È­­©ó¥»Ÿ÷ªº bin ¥Ø¿ý€º¡Ašä¥L¥Ø¿ý€]€£¥i¥H¡C

ŠpªGŠ³¿³œì·dªºžÜ¡A§Ú°O±o MSDN €WŠ³°ÊºAœsĶ¡Bžü€J²Õ¥óªºœdšÒ¡A§A¥i¥H¥hœœ¡C
©ó news:A0261B56-B5D4-46FB-ADAC-F1C7319096F5%40microsoft.com µoªí
œÐ°Ý¡A
¥ŽºâÅýšä¥L¹qž£€Wªº±M®×€Þ¥Î¡A
§ÚŠbªñºÝ¹qž£ªº¬Y­Ó±M®×¡A
±q[¥[€J°ÑŠÒ]ªºŠa€è€Þ¥Î»·ºÝ¹qž£€WªºUtil.dll¡A
µM«áŠbžÓdllÄÝ©Ê€€ªº[œÆ»s¥»Ÿ÷]³]¬°false¡A
Š]¬°§Ú€£§Æ±æšC¥x¹qž£€Wªº±M®×¡A
Šb³]­p¶¥¬qŽN§â·í€UªºUtil.dllœÆ»sšì¥»Ÿ÷¡A
ÁקK±NšÓ§ó·sUtil.dll€Wªº§xÂZ¡A
§Ú¬O§Æ±æ¯àŠbRunTime®É§Y®É€Þ¥Î³Ì·sª©¥»¡A
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<codeBase href="http://remote_computert/Util/bin/Util.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>¡A
ªñºÝ¹qž£€Wªº±M®×¡A
Šb³]­p¶¥¬q¬O¥i¥Hªœ±µ€Þ¥ÎUtil€ºªºšçŒÆ¡A
œsĶ€W€]šS°ÝÃD¡A
¥i¬O°õŠæ€§«á¡A
'/WebApplication1' À³¥Îµ{Š¡€€µo¥ÍŠøªAŸ¹¿ù»~¡C
--------------------------------------------------------------------------------
Žy­z: Šb°õŠæ¥Ø«e Web ­nšDªº¹Lµ{€€µo¥Í¥Œ³B²zªºšÒ¥~±¡§Î¡CœÐÀËŸ\°ïÅ|°lÂÜ¥Hšú±o¿ù»~ªºžÔ²Óžê°T¡A¥H€ÎŠbµ{Š¡œX€€²£¥ÍªºŠìžm¡C
Šb°õŠæ¥Ø«e Web ­nšDŽÁ¶¡¡A²£¥ÍµLªk³B²zªºšÒ¥~ª¬ªp¡CŠp»ÝŠ³ÃöšÒ¥~ª¬ªpšÓ·œ»PŠìžmªºžê°T¡A¥i¥HšÏ¥Î€UŠCªºšÒ¥~ª¬ªp°ïÅ|°lÂÜšú±o¡C
²Õ¥óžü€J°lÂÜ: €UŠCžê°TŠbœT©w¬°ŠóµLªkžü€J²Õ¥ó 'Util' ®É¬OŠ³À°§Uªº¡C
=== Pre-bind state information ===
LOG: DisplayName = Util, Version=1.0.2438.20906, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/WEB/WebApplication1
LOG: Initial PrivatePath = bin
Calling assembly : WebApplication1, Version=1.0.2440.22006, Culture=neutral,
PublicKeyToken=null.
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: Util, Version=1.0.2438.20906, Culture=neutral,
PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util/Util.DLL.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util.DLL.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util/Util.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/webapplication1/3b121e12/24f42f4c/Util/Util.EXE.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util.EXE.
LOG: Attempting download of new URL
file:///D:/WEB/WebApplication1/bin/Util/Util.EXE.
€£ªŸ¹DŠpŠó€~¯àŠbRunTime®É§Y®É€Þ¥Î»·ºÝ¹qž£€Wªº²Õ¥ó¡A
œÐŠUŠì¥ý¶i«ü±Ð¡A
ÁÂÁÂ!!
Eric
--
­·¬ê¬ì§ÞÅçÃÒŠ³­­€œ¥q ASP.NET Web News Reader 0.2.3 UTF-8 Beta
ºô¯žŠa¹Ï http://tlcheng.twbbs.org/wwwmap.htm
¬y°ìšŸ¬x/°Ï°ì€ôžê·œ/®}ª@ºô/ªŽºÀ¹Ï/»y­µ³q°T €å³¹»Pµ{Š¡
Basic/Fortran/Windows API/.Net/»²§U»¡©úÀÉ ­ì©lœX¡B€å³¹»P°Qœ×
·L³nµ{Š¡³]­p·s°Qœ×°Ï MSDN §Þ³Nœ×ŸÂ¡Aºô€ÍŠ^ÂЫá§Y®É²°T¡B¹q€l¶l¥ó³qªŸ¡G
http://forums.microsoft.com/msdn-cht/default.aspx?siteid=14
--
ASPNET News Reader http://tlcheng.twbbs.org/News/Reader.aspx
RSS 2.0 http://tlcheng.twbbs.org/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.aspnet
继续阅读narkive:
Loading...