clement
clement

Reputation: 4266

can't use the GAC for EnterpriseLibrary.Data

I'm using the GAC to share dll's.

Here, I have an application that use the Microsoft.Practices.EnterpriseLibrary.Data.dll 5.0.414.0. if I put it on the same folder than the .exe, all is OK, but when I want to remove it from this folder, it doesn't working, even if I installed it on the GAC...

I installed it on the GAC thanks to

D:\Applications\Services\App>GACUTIL.exe -i Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

When I remove this dll from this folder, the app isn't run correctly, why?

I tried the GAC woth others dll's and it's ok, and When I go to C:\WINDOWS\assembly, the dll looks like it's installed!

I already re-tryed to install it with the CLI that I shown you before.

EDIT:

Type:

Exception type:
Microsoft.Practices.ServiceLocation.ActivationException, Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Message:

Activation error occured while trying to get instance of type LogWriter, key ""

Stack:

Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer()
MyFramework.Logging.MyLogger.WriteVerbose(String applicationName, String title, String logText)
MyApp.Fleet_Service.GetInfo(Int32 accountid, String[] msisdns, DateTime from, DateTime to) in c:\Clients\Project\V1\Fleet_Service.cs:line 111
SyncInvokeGetInfo(Object , Object[] , Object[] )

Thanks to help me

Upvotes: 0

Views: 2028

Answers (1)

Paolo Tedesco
Paolo Tedesco

Reputation: 57222

Depending on the .NET version you are using, the GAC might not be in C:\Windows\Assembly.
For .NET 4, the GAC is located at %windir%\Microsoft.NET\assembly\.
In general, if you want to understand why a .NET application does not find an assembly, you should use the Assembly Binding Log Viewer tool (fuslogvw.exe from a VS command prompt).

EDIT: after seeing your comment, it could be that it's not your application directly that is trying to load the assembly that fails, but maybe some other dll. Use the assembly binding log viewer tool to determine what is failing and why. Also, it would be better if you provided some more details on how your application is failing (error message, stack trace...)

Upvotes: 1

Related Questions