作者NewWuman (不攻擊奇用謀兵詐)
看板C_Sharp
標題[問題] Remote CodeBase
時間Tue Aug 9 10:01:18 2011
大家好
我有一個dll。該dll被上傳到我的google site網路空間。
我想在每次啟用程式時從此網路空間得到dll,
所以我的App.config包含下列代碼。
想請問問什麼不能工作?
-----------------------------------------------------------------------------
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CarLibrary"
publicKeyToken="5039e5527e57af41">
</assemblyIdentity>
<codeBase version="2.0.0.0"
href ="
https://sites.google.com/site/u901833/CarLibrary.dll">
</codeBase>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
------------------------------------------------------------------------------
程式碼以及相關執行檔
https://sites.google.com/site/u901833/MyCSharpCodeRemote.zip
麻煩下載後直接解壓縮置於C:
補充:
此CarLibrary.dll已經被強命名(strong name)
1.
當此dll其deploy在GAC時
點擊CodeBaseClient.exe可以正常工作
(跑出console視窗並且顯示"***** Fun with CodeBases ****",
並且跳出一個MessageBox顯示"CarLibrary Version 2.0!")
2.
把此dll從GAC裡反安裝,並把CodeBaseClient.exe.config裡的href改為以下
file:///C:\MyCSharpCode\MyAsm\CarLibrary.dll
點擊CodeBaseClient.exe可以正常工作
3.
把CodeBaseClient.exe.config裡的href改為以下
https://sites.google.com/site/u901833/CarLibrary.dll
點擊CodeBaseClient.exe卻不能運作
照理說應該此dll應該會被下載至GAC然後程式會運作
不過看來沒有
想請問各位前輩是哪理出錯
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.251.193.123
1F:→ pico2k:你的做法達不到你想要的目的... 08/09 11:58
2F:→ pico2k:請改用Reflection 08/09 13:23
3F:→ NewWuman:謝樓上回應 我知道可以用later-binding來作 08/09 15:36
4F:→ NewWuman:但我在書上看到範例說這樣可以work 08/09 15:37
5F:→ pico2k:書上的範例裡的網址是http or https? 08/09 16:10
6F:→ NewWuman:是http 但這我檢查過 把上述的https改為http放到href仍然 08/09 19:04
7F:→ NewWuman:不能work 08/09 19:05