<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JUST DO IT ~

    我只想當個程序員

    認識 : 看了 淺談.NET中的版本管理 ildasm.exe MyForm.exe

    看了  淺談.NET中的版本管理
    http://www.microsoft.com/china/community/program/originalarticles/techdoc/DOTNETVersion.mspx


    GAC:
    計算機范圍內的代碼緩存,它存儲專門安裝的程序集,這些程序集由計算機上的許多應用程序共享。在全局程序集緩存中部署的應用程序必須具有強名稱,一個程序集如果注冊到了GAC里,被其他程序集合引用的時候,將不會拷貝副本到引用的程序目錄中。 (本文只討論注冊到GAC中的程序集)

    實際就是  system32\ 目錄的做的作用, 系統安裝一份 就可以了,
    其他的程序要用 , 直接到界面上去引用, 不會有任何問題. 在系統 using 直接調,  ------反正就是不需要注冊組件文件拷貝.............
    如果沒有 代碼緩存 ...必須要自己注冊dll 文件 然后程序來引用

    好處 : 

    1 多版本維護替換dll

    他的另外一個作用在文中提及,就是可以進行多個版本注冊....... 使用的程序是 1.0dll編譯的 ..在升級到GAC到第二版dll ..................使用的程序不需要重新編譯,只要對 config 文件進行版本替換就可以的....
    這個是比較好的特點,允許我們輕松處理dll的版本
    雖然COM中 使用注冊表和 也能做到這點 dll     但是好像很復雜 .....

    2.實現簡單......
      步驟   
    1//首先生成強名稱到文件中
    sn –k c:\Version.snk2  //寫類文件
    v1.cs
    using System;
    using System.Reflection;
    [assembly: AssemblyKeyFile(@"c:\Version.snk")] //因為注冊到GAC,所以使用強名稱簽名
    [assembly: AssemblyVersion("1.0.0.0")] //設置版本號
    namespace V1 {

     3 匯編查看代碼

        D:\c_\forms>ildasm.exe MyForm.exe
    匯編 虛擬機代碼 看實質


    ame是程序集的名稱 publicKeyToken是公匙的標記;

    // Metadata version: v2.0.50727
    .assembly extern /*23000001*/ 'System.Windows.Forms'
    {
      .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
      .ver 2:0:0:0
    }

    打開%SystemDir%\assembly


    替換dll 不要拷貝文件

    TestVersion.exe.config里面打入
    <?xml version="1.0"?>
    <configuration>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="V1" publicKeyToken=" 758fe4e9db9d8251"/>
    <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>
    











    大致對 dotnet下同版本理解

    DotNet中的版本由4個物理號碼組成,如圖(一)
    Assembly Info 的參數理解

    描述整個程序 版本名稱,
    版本號碼 GUI


    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;

    // General Information about an assembly is controlled through the following 
    // set of attributes. Change these attribute values to modify the information
    // associated with an assembly.
    [assembly: AssemblyTitle("NHibernateWithAccess")]
    [assembly: AssemblyDescription(
    "A sample application showing how to use NHibernate with Access/Jet")]
    [assembly: AssemblyConfiguration(
    "")]
    [assembly: AssemblyCompany(
    "")]
    [assembly: AssemblyProduct(
    "NHibernateWithAccess")]
    [assembly: AssemblyCopyright(
    "")]
    [assembly: AssemblyTrademark(
    "")]
    [assembly: AssemblyCulture(
    "")]

    // Setting ComVisible to false makes the types in this assembly not visible 
    // to COM components.  If you need to access a type in this assembly from 
    // COM, set the ComVisible attribute to true on that type.
    [assembly: ComVisible(false)]

    // The following GUID is for the ID of the typelib if this project is exposed to COM
    [assembly: Guid("da9b5517-7c63-4ed2-8f42-e573af1df70b")]

    // Version information for an assembly consists of the following four values:
    //
    //      Major Version
    //      Minor Version 
    //      Build Number
    //      Revision
    //
    [assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion(
    "1.0.0.0")]






    sn –k c:\Version.snk
    





    posted on 2008-09-15 12:14 小高 閱讀(622) 評論(0)  編輯  收藏 所屬分類: Build構建|git版本控制

    導航

    <2008年9月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(352)

    收藏夾(19)

    關注的blog

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产麻豆视频免费观看| 国产情侣久久久久aⅴ免费| 日本特黄a级高清免费大片| 国产 亚洲 中文在线 字幕| 台湾一级毛片永久免费| 亚洲日韩国产精品无码av| 8x8x华人永久免费视频| 亚洲国产成人精品无码区在线网站| 99久久国产免费-99久久国产免费 99久久国产免费中文无字幕 | 在线观看亚洲精品国产| 久久er国产精品免费观看8| 亚洲色婷婷综合久久| 免费日本一区二区| 亚洲美女激情视频| 成年女人喷潮毛片免费播放| 国产精品无码亚洲精品2021| 亚洲精品国精品久久99热| 中文字幕免费在线播放| 久久国产亚洲电影天堂| 成人福利免费视频| 亚洲av成人一区二区三区观看在线 | 亚洲精品无码中文久久字幕| 国产成人高清精品免费鸭子| 日本精品久久久久久久久免费| 亚洲中文字幕无码日韩| 99热这里有免费国产精品| 中文字幕 亚洲 有码 在线 | 国产精品亚洲一区二区三区在线| 69免费视频大片| 亚洲精品无码av片| 精品久久香蕉国产线看观看亚洲| 久久永久免费人妻精品下载| 亚洲人成色4444在线观看| 亚洲午夜精品第一区二区8050| 青青草无码免费一二三区| 亚洲色大网站WWW永久网站| 久久精品国产精品亚洲下载| 国产成人精品免费午夜app| 理论秋霞在线看免费| 亚洲视频精品在线观看| 少妇亚洲免费精品|