使用gacutil.exe擷取GAC中程式集全名稱資訊

來源:互聯網
上載者:User

今天寫一個WPF程式需要綁定PresentationFramework類庫中的一個類型,由於它是GAC中的強命名程式集,指定程式集名稱是需要程式集的詳細資料(比如版本,公開金鑰標記(Public Key Token))。其實使用一些反編譯工具比如Reflector或者ILSpy可以順利得到指定程式集的全稱資訊。但是.NET Framework SDK中沒有內建工具嗎?答案就是gacutil.exe。

 

使用gacutil.exe的/l參數(注意是小寫L,代表list),後面加上要搜尋的程式集名稱,然後gacutil會輸出GAC中相應名稱的程式集名稱資訊。

 

樣本:

開啟Visual Studio Command Prompt。

比如要查詢”PresentationFramework”,輸入:

gacutil /l presentationframework

 

gacutil會輸出如下資訊:

The Global Assembly Cache contains the following assemblies:

  presentationframework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf38

56ad364e35, processorArchitecture=MSIL

  presentationframework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf38

56ad364e35, processorArchitecture=MSIL

 

Number of items = 2

拷貝需要的程式集資訊就可以了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.