title: VS 2010 error "Value to add was out of range. Parameter name: value "
body: <p>I am facing a weird problem. My web application throws error "Value to add was out of range Parameter name :value ". Now this is not every time I run the program.Sometimes shows error and sometimes runs without problems (no changes done).stack traces given below the error is not clear (at least for me). Anybody faced this kind of issue ?</p>
  
  <h1>Error Details</h1>
  
  <p>Value to add was out of range.
  Parameter name: value 
  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>
  
  <pre><code>Exception Details: System.ArgumentOutOfRangeException: Value to add was out of range.
  Parameter name: value
  
  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.  
  
  Stack Trace: 
  
  
  [ArgumentOutOfRangeException: Value to add was out of range.
  Parameter name: value]
     System.DateTime.Add(Double value, Int32 scale) +9388319
     System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8837703
     System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
     System.Web.Compilation.BuildManager.CompileCodeDirectories() +319
     System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +248
  
  [HttpException (0x80004005): Value to add was out of range.
  Parameter name: value]
     System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62
     System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +421
     System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31
     System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +605
  
  [HttpException (0x80004005): Value to add was out of range.
  Parameter name: value]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9013676
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
     System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
  
  
  
  
  --------------------------------------------------------------------------------
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/eIIIx.jpg" alt="enter image description here"></p>