<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

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产免费一区二区三区在线观看| 在线免费观看中文字幕| 亚洲综合一区二区精品久久| 免费无码AV片在线观看软件| 日韩精品视频在线观看免费| 亚洲第一视频网站| 免费观看的毛片手机视频| 免费无码又爽又刺激网站直播| 久久精品国产亚洲AV蜜臀色欲| 亚洲黄黄黄网站在线观看| 95老司机免费福利| 一级毛片成人免费看a| 国产裸体美女永久免费无遮挡| 青青草原精品国产亚洲av| 国产午夜无码视频免费网站 | 黄页网站在线视频免费| 久久亚洲国产精品| 免费国产不卡午夜福在线| 亚洲黄色免费在线观看| eeuss影院www天堂免费| 亚洲色欲啪啪久久WWW综合网| 亚洲精品乱码久久久久久自慰| 免费特级黄毛片在线成人观看| 99久久免费看国产精品| sihu国产精品永久免费| 亚洲日本成本人观看| 亚洲黑人嫩小videos| 亚洲色欲久久久综合网| 四虎永久免费网站免费观看| 国产人成免费视频网站| 永久免费A∨片在线观看| 特级av毛片免费观看| 亚洲愉拍一区二区三区| 18gay台湾男同亚洲男同| 亚洲色欲久久久综合网| 免费人成视频在线观看不卡| 免费看AV毛片一区二区三区| 亚洲网站免费观看| 99国产精品免费视频观看| 色播在线永久免费视频网站| 男性gay黄免费网站|