title: Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code
body: <p>I am working on migrating the current ASP.NET application from 2.0 to 4.0 and also trying to migrate the enterprise library to 5.0 from 4.0</p>
  
  <p>I have made all the necessary changes in the configuration file. All the application is working on project mates machine but it is not working on my machine. </p>
  
  <p>Stack Trace of the error I am getting --- </p>
  
  <pre><code>Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code
    HResult=-2146233088
    Message=Activation error occured while trying to get instance of type LogWriter, key ""
    Source=Microsoft.Practices.ServiceLocation
    StackTrace:
         at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
         at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
         at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer()
         at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log)
         at App.LogEntryHelper.WriteLogEntry(LogEntry entry, String category) in c:\App.Client.WebUI\AppCode\LogEntryHelper.cs:line 252
         at App.LogEntryHelper.WriteFacadePerformanceLog(DateTime start, DateTime end) in c:\App.Client.WebUI\AppCode\LogEntryHelper.cs:line 209
         at App.Facade.FutureEventFacade.GetFutureEventsParticipant(Int64 participantID) in c:\App.Client.WebUI\Facade\FutureEventFacade.cs:line 92
         at App.Facade.ParticipantFacade.GetParticipant(Int64 participantID) in c:\App.Client.WebUI\Facade\ParticipantFacade.cs:line 81
         at App.ParticipantPage.Page_Load(Object sender, EventArgs e) in c:\App.Client.WebUI\ParticipantPage.aspx.cs:line 67
         at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
         at System.Web.UI.Control.OnLoad(EventArgs e)
         at System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e)
         at System.Web.UI.Control.LoadRecursive()
         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    InnerException: Microsoft.Practices.Unity.ResolutionFailedException
         HResult=-2146233088
         Message=Resolution of the dependency 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)
  
         Source=Microsoft.Practices.Unity
         TypeRequested=LogWriter
         StackTrace:
              at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
              at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
              at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key)
              at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
         InnerException: System.InvalidOperationException
              HResult=-2146233079
              Message=The type LogWriter cannot be constructed. You must configure the container to supply this value.
              Source=Microsoft.Practices.Unity
              StackTrace:
                   at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimitive(IBuilderContext context, SelectedConstructor selectedConstructor)
                   at Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.PreBuildUp(IBuilderContext context)
                   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                   at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlanCreatorPolicy.CreatePlan(IBuilderContext context, NamedTypeBuildKey buildKey)
                   at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
                   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
              InnerException: 
  </code></pre>
  
  <p>Here are the details of configuration file </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;
    &lt;configSections&gt;
      &lt;section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
      &lt;section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
      &lt;section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&gt;
      &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
        &lt;section name="App.Properties.SecuritySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
        &lt;section name="App.Properties.ReportingSettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
        &lt;section name="App.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
      &lt;/sectionGroup&gt;
      &lt;sectionGroup name="system.web"&gt;
        &lt;section name="uploadManagement" type="App.WebControls.UploadModule, App.WebControls"/&gt;
      &lt;/sectionGroup&gt;
      &lt;!-- AJAX --&gt;
      &lt;!-- End AJAX --&gt;
    &lt;/configSections&gt;
    &lt;loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="" logWarningsWhenNoCategoriesMatch="true"&gt;
      &lt;listeners&gt;
        &lt;add fileName="App.Debug.log" header="----------------------------------------" footer="----------------------------------------" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Debug Flat File TraceListener"/&gt;
        &lt;add fileName="App.Client.WebUI.Facade.Performance.log" header="----------------------------------------" footer="----------------------------------------" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Facade Performance Flat File TraceListener"/&gt;
        &lt;add fileName="App.Exception.log" rollSizeKB="10000" timeStampPattern="ddd" rollFileExistsBehavior="Overwrite" rollInterval="Day" formatter="Text Formatter" header="----------------------------------------" footer="----------------------------------------" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="Callstack" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Rolling Flat File TraceListener"/&gt;
        &lt;add source="AdminTool Web UI" formatter="Text Formatter" log="AdminTool" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="Callstack" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="WebUI EventLog TraceListener"/&gt;
        &lt;add fileName="App.SSO.log" header="----------------------------------------" footer="----------------------------------------" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="SSO Flat File TraceListener"/&gt;
      &lt;/listeners&gt;
      &lt;formatters&gt;
        &lt;add template="Timestamp: {timestamp}&amp;#xA;Message: {message}&amp;#xA;Category: {category}&amp;#xA;Priority: {priority}&amp;#xA;EventId: {eventid}&amp;#xA;Severity: {severity}&amp;#xA;Title:{title}&amp;#xA;Machine: {machine}&amp;#xA;Application Domain: {appDomain}&amp;#xA;Process Id: {processId}&amp;#xA;Process Name: {processName}&amp;#xA;Win32 Thread Id: {win32ThreadId}&amp;#xA;Thread Name: {threadName}&amp;#xA;Extended Properties: {dictionary({key} - {value}&amp;#xA;&amp;#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Text Formatter"/&gt;
      &lt;/formatters&gt;
      &lt;logFilters&gt;
        &lt;add minimumPriority="0" maximumPriority="3" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Priority Debug Filter"/&gt;
      &lt;/logFilters&gt;
      &lt;categorySources&gt;
        &lt;add switchValue="All" name="Web UI Debug"&gt;
          &lt;listeners&gt;
            &lt;add name="Debug Flat File TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
        &lt;add switchValue="All" name="Web UI Exception"&gt;
          &lt;listeners&gt;
            &lt;add name="Rolling Flat File TraceListener"/&gt;
            &lt;add name="WebUI EventLog TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
        &lt;add switchValue="All" name="Web UI Facade Performance"&gt;
          &lt;listeners&gt;
            &lt;add name="Facade Performance Flat File TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
        &lt;add switchValue="All" name="Web UI SSO"&gt;
          &lt;listeners&gt;
            &lt;add name="SSO Flat File TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
      &lt;/categorySources&gt;
      &lt;specialSources&gt;
        &lt;allEvents switchValue="All" name="All Events"/&gt;
        &lt;notProcessed switchValue="All" name="Unprocessed Category"&gt;
          &lt;listeners&gt;
            &lt;add name="Debug Flat File TraceListener"/&gt;
            &lt;add name="WebUI EventLog TraceListener"/&gt;
            &lt;add name="SSO Flat File TraceListener"/&gt;
          &lt;/listeners&gt;
        &lt;/notProcessed&gt;
        &lt;errors switchValue="All" name="Logging Errors &amp;amp; Warnings"/&gt;
      &lt;/specialSources&gt;
    &lt;/loggingConfiguration&gt;
    &lt;exceptionHandling&gt;
      &lt;exceptionPolicies&gt;
        &lt;add name="WebUI Policy"&gt;
          &lt;exceptionTypes&gt;
            &lt;add type="System.DirectoryServices.DirectoryServicesCOMException, System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" postHandlingAction="None" name="DirectoryServicesCOMException"/&gt;
            &lt;add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="None" name="Exception"&gt;
              &lt;exceptionHandlers&gt;
                &lt;add logCategory="Web UI Exception" eventId="2000" severity="Error" title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Logging Handler"/&gt;
              &lt;/exceptionHandlers&gt;
            &lt;/add&gt;
          &lt;/exceptionTypes&gt;
        &lt;/add&gt;
      &lt;/exceptionPolicies&gt;
    &lt;/exceptionHandling&gt;
  &lt;/configuration&gt;
  </code></pre>