[問題] Remote CodeBase

看板C_Sharp (C#)作者 (不攻擊奇用謀兵詐)時間14年前 (2011/08/09 10:01), 編輯推噓0(007)
留言7則, 2人參與, 最新討論串1/1
大家好 我有一個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 ="" rel="nofollow">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

08/09 11:58, , 1F
你的做法達不到你想要的目的...
08/09 11:58, 1F

08/09 13:23, , 2F
請改用Reflection
08/09 13:23, 2F

08/09 15:36, , 3F
謝樓上回應 我知道可以用later-binding來作
08/09 15:36, 3F

08/09 15:37, , 4F
但我在書上看到範例說這樣可以work
08/09 15:37, 4F

08/09 16:10, , 5F
書上的範例裡的網址是http or https?
08/09 16:10, 5F

08/09 19:04, , 6F
是http 但這我檢查過 把上述的https改為http放到href仍然
08/09 19:04, 6F

08/09 19:05, , 7F
不能work
08/09 19:05, 7F
文章代碼(AID): #1EG9Jn_M (C_Sharp)
文章代碼(AID): #1EG9Jn_M (C_Sharp)