title: Can ToArray() throw an exception?
body: <p>While the answer to <a href="https://stackoverflow.com/questions/3128889/lock-vs-toarray-for-thread-safe-foreach-access-of-list-collection">this question</a> is excellent, it implies that you should surround calls to List.ToArray() in a lock for concurrency.  <a href="http://codewordsharp.nojo.se/2012/12/toarray-isnt-threadsafe.html" rel="nofollow noreferrer">this blog post</a> also implies that it could fail catastrophically (but rarely).  I typically use ToArray rather than a lock in when enumerating Lists or other collections in order to avoid the "Collection Modified, Enumeration may not complete" exception.  This answer and the blog post have called that assumption into question.</p>
  
  <p>The documentation for List.ToArray() does not list any exceptions, so I have always assumed that it will always complete (albeit maybe with stale data) and that while it is not thread safe from a data consistency point of view, it is thread safe from a code execution point of view - in other words, it won't throw an exception and calling it won't corrupt the internal data structure of the underlying collection.  </p>
  
  <p>If this assumption isn't correct, then while it has never caused a problem it could be a timebomb in a high availability application.  What is the definitive answer?</p>