System.MissingMethodException Int32 System.Environment. get_CurrentManagedThreadId()

CurrentManagedThreadId is a .NET 4.5 property, so you will need 4.5 to run the code.
See Iterator blocks, missing methods, and .NET 4.5 for an analysis of how this problem might occur.

In short:

If you build your application (targeted at .NET 4.0) on a system with .NET 4.5 installed, it will use 4.5 as basis for the compilation, because the .NET 4.0 Framework is always overwritten by .NET 4.5.

If your application then also uses yield return, it will fail on systems having only 4.0 installed because the implementation of this statement uses a new property when compiled for the 4.5 Framework.

To solve it, make sure your compiler system has the 4.0 reference assemblies.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)