简体   繁体   中英

Assembly not being located in GAC but gacutil shows it's there

I have noticed some strange behaviour on my system regarding the Global Assembly Cache (GAC). The assembly I'm interested in is log4net Version= 1.2.11.0

The output of gacutil /l "log4net" is:

C:\\Windows\\system32>gacutil /l "log4net" Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved.

The Global Assembly Cache contains the following assemblies:
log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL
log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL

Number of items = 2

However viewing the GAC through the explorer shell (before and after a restart) only shows one version:

在此处输入图片说明

This is compounded by the fact that my application cannot resolve the assembly, but works fine when I place it into the application base (bin folder). According to this article the GAC will be probed before the application base - which would point to the assembly not being in the GAC.

So is log4net Version=1.2.11.0 in the GAC? If so why can't my application locate it?

You are looking in the .NET 2.0 GAC, however, log4net v1.2.11.0 is a .NET 4 assembly. .NET 4 has its own GAC which is located in %winddir%\\Microsoft.NET\\Assembly . Check the GAC_MSIL directory in there and I'll bet you'll find it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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