试试用:TemplateSourceDirectory 看能否获得。

解决方案 »

  1.   

    TemplateSourceDirectory ???如何用?? 我写的是dll组件,不是有界面的那类组件呀。
      

  2.   

    它是Control类的一个属性,只要你的类是从System.Web.Control继承的,就可以直接用这个属性。
      

  3.   

    this guy is asking the same question and check the answer from other people, it is same answer I told you yesterday
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=enE4STBBDHA.1220%40TK2MSFTNGP11.phx.gbl&rnum=2&prev=/groups%3Fq%3DGAC%2Bassembly%2Blocation%2Boriginal%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DenE4STBBDHA.1220%2540TK2MSFTNGP11.phx.gbl%26rnum%3D2
      

  4.   

    this answer from Microsoft is interesting, but I couldn't find the information from __AssemblyInfo__.ini:
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=T%24Qixs58CHA.2324%40cpmsftngxa06
      

  5.   

    为什么一定要这个信息呢?
    既然.NET已经在GAC里面保存了assembly的一个copy,那么原来的路径和文件信息就是多余的。事实上在安装之后你甚至可以安全的删掉原始文件。
      

  6.   

    Yes, saucer is right.
    Microsoft does keep a copy of the CodeBase information in the __AssemblyInfo__.ini, it's named URL. For example:C:\WINNT\assembly\GAC\TestServer\1.0.0.0__0cb579616e939126>type __AssemblyInfo__.Ini
    [AssemblyInfo]
    MVID=ba958a132a5a634f8e58d3f7d0508f95
    URL=file:///C:/PROGRA~1/MICROS~2.NET/FRAMEW~1/Samples/QuickStart/howto/samples/interop/testserver_1/vb/TestServer.dll
    DisplayName=TestServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0cb579616e939126
      

  7.   

    I told 蝈蝈, an assembly in GAC is independent, he doesn't believe me, :-(
      

  8.   

    他的意思是:现在有一个Assembly - A
    装在
    C:\A 里。
    附带一些文件,例如a.jpg,a.avi,a.doc,a.xml之类的。因为某些原因,要把 A 装在 GAC 中。那么程序引用的是GAC中的A咯。但是怎样才能得到a.jpg,a.avi...呢?
    -----------------------------------------。实际上,这是个协议,不是技术上的问题,看你怎样定而已。例如A是个独立的组件,那么可以在安装的时候把相关文件路径记录到注册表中啊。。
      

  9.   

    对,我的意思就是: LevinForum 所说的,因为那个目录下有这个组件的一些配置信息文件。我要获得这个文件的具体路径。这个路径又不好写死。只有这样了。但是却无法获得。郁闷。
      

  10.   

    to : webdiyer(陕北吴旗娃) 我写的不是Web组件,是没有界面,只有算法、运算的组件,当然不是从  System.Web.Control继承的
      

  11.   

    目前就只有一个方法,去读取 __AssemblyInfo__.ini 文件中的信息。
      

  12.   

    如果是Winform下面的dll,可以在做安装程序的时候写注册表啊。
      

  13.   

    ghj1976 (蝈蝈俊.net) :是个爱钻牛角尖人,他问的问题都有点“变态”的。 :)
      

  14.   

    i can't find the file of _AssemblyInfo_.ini,why?