简体   繁体   English

C#汇编-获取在gacutil中注册之前的路径

[英]C# assembly - get path where it was before being registered with gacutil

Is there any way to get the path of an assembly registered with gacutil /i myassembly.dll ? 有什么方法可以获取在gacutil / i myassembly.dll中注册的程序集的路径吗?

I mean the path where the .dll file was at the moment it was registered with this command. 我的意思是.dll文件在此命令中注册时的路径。 All that I get right now is the path in the GAC 我现在得到的只是GAC中的道路

No. When you register an assembly in GAC, gacutil makes a copy of the dll in Windows\\assembly (or Windows\\Microsoft.NET\\assembly for .NET 4.0). 否。当您在GAC中注册程序集时,gacutil会在Windows \\ assembly(或.NET 4.0的Windows \\ Microsoft.NET \\ assembly)中复制dll。 It doesn't keep any info on the location of the original assembly. 它不保留有关原始装配体位置的任何信息。

EDIT: You can however add a custom trace to your assembly when installing, using /ir option instead of /i 编辑:但是,您可以在安装时使用/ir选项而不是/i将自定义跟踪添加到您的程序/ir

gacutil /ir myassembly.dll OPAQUE "Custom application details" "Custom description"

and then retrieve the details using /lr option 然后使用/lr选项检索详细信息

gacutil /lr myassembly.dll

More info on tracing here 有关在此处跟踪的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM