title: Exception thrown by type initializer for 'Microsoft.TeamFoundation.Framework.Server.ByteArray'
body: <p>Please anyone has an idea what is causing this error while checking in files on tfs:</p>
  
  <p>"The type initializer for 'Microsoft.TeamFoundation.Framework.Server.ByteArray' threw an exception."</p>
  
  <p>this is the stack trace from the event Viewer:</p>
  
  <pre><code>**TF53010: The following error has occurred in a Team Foundation component or extension:
  Date (UTC): 4/7/2014 5:57:14 AM
  Machine: TFSSRV
  Application Domain: /LM/W3SVC/8080/ROOT/tfs-14-130413234339367965
  Assembly: Microsoft.TeamFoundation.Framework.Server, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
  Service Host: 61e34d8a-3995-492a-b0b1-b1ca43304366 (SABIS)
  Process Details:
    Process Name: w3wp
    Process Id: 3896
    Thread Id: 4844
    Account name: INTEREDLB\eghanem
  Detailed Message: TF30065: An unhandled exception occurred.
  Web Request Details
      Url: tfssrv:8080/tfs/_tfs_resources/VersionControl/v1.0/upload.ashx [method: POST]
      User Agent: Team Foundation (devenv.exe, 10.0.30319.1)
      Headers: Content-Length=125836&amp;Content-Type=multipart%2fform-data%3b+boundary%3d--------------------------8e5m2D6l5Q4h6&amp;Accept-Language=en-US&amp;Authorization=NTLM+TlRMTVNTUAADAAAAGAAYAIQAAABcAVwBnAAAABIAEgBYAAAADgAOAGoAAAAMAAwAeAAAAAAAAAD4AQAABYKIogYC8CMAAAAPEamXFnqofvmag9Tv7MumY0kATgBUAEUAUgBFAEQATABCAGUAZwBoAGEAbgBlAG0ASQBUAFEAQwAwADIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgPJ7o8t9UpE1fWPVvOiQkwEBAAAAAAAAOSm6OSZSzwGLmc3OzEbnlAAAAAACABIASQBOAFQARQBSAEUARABMAEIAAQAMAFQARgBTAFMAUgBWAAQAJgBpAG4AdABlAHIAZQBkAGwAYgAuAHMAYQBiAGkAcwAuAG4AZQB0AAMANAB0AGYAcwBzAHIAdgAuAGkAbgB0AGUAcgBlAGQAbABiAC4AcwBhAGIAaQBzAC4AbgBlAHQABQASAHMAYQBiAGkAcwAuAG4AZQB0AAgAMAAwAAAAAAAAAAEAAAAAIAAAPo4lTXR7%2fzg5WQsBAME%2f5oXFLmv2XYbJUNBj1fLeBfkKABAAAAAAAAAAAAAAAAAAAAAAAAkAPgBIAFQAVABQAC8AdABmAHMAcwByAHYALgBpAG4AdABlAHIAZQBkAGwAYgAuAHMAYQBiAGkAcwAuAG4AZQB0AAAAAAAAAAAA&amp;Expect=100-continue&amp;Host=tfssrv%3a8080&amp;User-Agent=Team+Foundation+(devenv.exe%2c+10.0.30319.1)&amp;X-TFS-Version=1.0.0.0&amp;X-TFS-Session=f705371b-1a30-4e4a-861c-62d652add5e3&amp;TF-Instance=f705371b-1a30-4e4a-861c-62d652add5e3
      Path: /tfs/_tfs_resources/VersionControl/v1.0/upload.ashx
      Local Request: False
      Host Address: 192.168.200.234
      User: INTEREDLB\eghanem [authentication type: NTLM]
  Exception Message: The type initializer for 'Microsoft.TeamFoundation.Framework.Server.ByteArray' threw an exception. (type TypeInitializationException)
  Exception Stack Trace:    at Microsoft.TeamFoundation.Framework.Server.ByteArray..ctor(Int32 sizeRequested)
     at Microsoft.TeamFoundation.VersionControl.Server.UploadHandler.UploadFile(VersionControlRequestContext versionControlRequestContext, String workspaceName, String workspaceOwner, String serverItem, Byte[] hash, Stream fileStream, Int64 fileLength, Int64 compressedLength, Int64 offsetFrom, CompressionType compressionType)
     at Microsoft.TeamFoundation.VersionControl.Server.TeamFoundationVersionControlService.UploadFile(TeamFoundationRequestContext requestContext, String workspaceName, String workspaceOwner, String serverItem, Byte[] hash, Stream fileStream, Int64 fileLength, Int64 compressedLength, Int64 offsetFrom, CompressionType compressionType)
     at Microsoft.TeamFoundation.VersionControl.Server.UploadHandler.Execute()
  Inner Exception Details:
  Exception Message: Exception of type 'System.OutOfMemoryException' was thrown. (type OutOfMemoryException)
  Exception Stack Trace:    at Microsoft.TeamFoundation.Framework.Server.BufferPool..ctor(Int32 bufferSize, Int32 initialNumberOfEntries)
     at Microsoft.TeamFoundation.Framework.Server.ByteArray..cctor()
  For more information, see Help and Support Center at** 
  </code></pre>