How do I know if I work with the PAC or not?

Given a class library library that can be installed on the GAC (production) or not (development), I need to know if the executable build is from the GAC or not. How can I know this?

+3
source share
3 answers

Have you tried checking the property Assembly.GlobalAssemblyCache?

bool loadedFromGac = this.GetType().Assembly.GlobalAssemblyCache;

... or:

bool loadedFromGac = Assembly.GetExecutingAssembly().GlobalAssemblyCache;
+8
source

Use the AssembyInfo class to find out the loaded assemblies for your application. The returned Assembly objects have a GlobalAssemblyCache property that indicates what you need.

Build MSDN Documents

+3
source

- , Fusion Log Viewer (fuslogvw.exe). Visual Studio ( Visual Studio Windows, ), Fusion Log Viewer , .

, , .. . , - , DLL .

Microsoft: https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

0
source

Source: https://habr.com/ru/post/1712864/


All Articles