locked
Enterprise Library RRS feed

  • Question

  • Is this a good place to ask Enterprise Library questions? If no, please tell me the right location.

    Basically I created a configuration file using the Ent lib config editor and renamed it to app.config. I also copied it, into my bin\debug folder

    however when I run my console exe it throws an error. The web is full of this error. everyone has asked this question so I am sure this is FAQ. but my understanding was that renaming the entlib config file to app.config and copying it with the console exe will resolve the issue.

     

     

    Unhandled Exception: Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to g
    et instance of type LogWriter, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the depend
    ency failed, type = "Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter", name = "(none)".
    Exception occurred while: while resolving.
    Exception is: InvalidOperationException - The type LogWriter cannot be constructed. You must configure the container to
    supply this value.
    -----------------------------------------------
    At the time of the exception, the container was:

      Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(none)
     ---> System.InvalidOperationException: The type LogWriter cannot be constructed. You must configure the container to su
    pply this value.
       at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext contex
    t, SelectedConstructor selectedConstructor) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\ObjectBuilder\Strategie
    s\BuildPlan\DynamicMethod\Creation\DynamicMethodConstructorStrategy.cs:line 289
       at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext context) in e:\Buil
    ds\Unity\UnityTemp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\BuildPlan\DynamicMethod\Creation\DynamicMethodConstr
    uctorStrategy.cs:line 71
       at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) in e:\Builds\Unity\UnityT
    emp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\StrategyChain.cs:line 110
       at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext context, NamedTy
    peBuildKey buildKey) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\BuildPlan\DynamicMeth
    od\DynamicMethodBuildPlanCreatorPolicy.cs:line 48
       at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) in e:\Builds\Unity\UnityT
    emp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\BuildPlan\BuildPlanStrategy.cs:line 37
       at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) in e:\Builds\Unity\UnityT
    emp\Compile\Unity\Unity\Src\ObjectBuilder\Strategies\StrategyChain.cs:line 110
       at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOve
    rrides) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 511
       --- End of inner exception stack trace ---
       at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOve
    rrides) in e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 515
       at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) in e:\
    Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:line 173
       at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key) in e:\Builds\Unity\Unity
    Temp\Compile\Unity\Unity\Src\UnityServiceLocator.cs:line 64
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Ch
    ris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 49
       --- End of inner exception stack trace ---
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Ch
    ris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 53
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]() in c:\Home\Chris\Projects\Commo
    nServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 90
       at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer() in e:\Builds\EntLib\Latest\Source\Blocks\Logging
    \Src\Logging\Logger.cs:line 408
       at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log) in e:\Builds\EntLib\Latest\Source\Blocks\
    Logging\Src\Logging\Logger.cs:line 303

    Friday, March 18, 2011 3:07 PM

Answers