title: Object reference not set to an instance of an object. in sitecore
body: <p>I moved all of the sitecore data developed in our local environment to the Amazon Web Service's Server.<br/>
  I attached database. setting IIS. and rewrote connection strings.<br/>
  But it doesn't work. I saw  error page like this when I access top page.</p>
  
  <blockquote>
    <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
    
    <p>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</p>
    
    <p>Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. </p>
  </blockquote>
  
  <p>Stack Trace: </p>
  
  <pre><code>[NullReferenceException: Object reference not set to an instance of an object.]
     Sitecore.Diagnostics.Log.Error(String message, Exception exception, Type ownerType) +246
     Sitecore.Configuration.Factory.LoadAutoIncludeFiles(ConfigPatcher patcher, String folder) +1064
     Sitecore.Configuration.Factory.GetConfiguration() +331
     Sitecore.Diagnostics.LoggerFactory..cctor() +58
  
  [TypeInitializationException: The type initializer for 'Sitecore.Diagnostics.LoggerFactory' threw an exception.]
     Sitecore.Diagnostics.LoggerFactory.GetLogger(Type type) +28
     Sitecore.Diagnostics.Log.Error(String message, Exception exception, Type ownerType) +150
     Sitecore.Configuration.Factory.LoadAutoIncludeFiles(ConfigPatcher patcher, String folder) +1065
     Sitecore.Configuration.Factory.GetConfiguration() +332
     Sitecore.Configuration.Factory.GetConfigNode(String xpath, Boolean assert) +117
     Sitecore.Resources.Media.UploadWatcher.InitializeIgnoreList() +182
  
  [TypeInitializationException: The type initializer for 'Sitecore.Resources.Media.UploadWatcher' threw an exception.]
     Sitecore.Resources.Media.UploadWatcher..ctor() +0
  
  [TargetInvocationException: Exception has been thrown by the target of an invocation.]
     System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
     System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +159
     System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark) +256
     System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
     System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark&amp; stackMark) +14407909
     System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +198
     System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
     System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
     System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +334
     System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262
     System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133
     System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
     System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
     System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
  
  [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12601936
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12441597
  </code></pre>
  
  <h2>Local environment</h2>
  
  <ul>
  <li>windows 7</li>
  <li>SQL Server 2012 sp1</li>
  <li>IIS 7.5</li>
  <li>Sitecore version 7.2</li>
  </ul>
  
  <h2>AWS environment</h2>
  
  <ul>
  <li>Windows Server R2 Standard</li>
  <li>SQL Server 2012 Express sp1</li>
  <li>IIS 8.5</li>
  <li>Sitecore version 7.2</li>
  </ul>
  
  <p>I have tried all the way written in this page(<a href="https://stackoverflow.com/questions/9587257/tracking-nullreferenceexceptions-in-sitecore">tracking NullReferenceExceptions in sitecore</a>)
  but these techniques doesn't work in this case.
  Please tell me how to do, if someone knows.
  Thank you.</p>