Managed Debugging Assistant 'LoaderLock' has detected a problem in C...

Jan 5, 2015 at 1:57 PM
I wrote such method:
        private static byte[] Compress(string name, byte[] bytes) {
            var compressor = new SevenZipCompressor();
            compressor.CompressionMethod = CompressionMethod.Lzma2;
            compressor.CompressionLevel = CompressionLevel.Ultra;
            compressor.DefaultItemName = name;

            using( var src = new MemoryStream( bytes ) )
            using( var result = new MemoryStream() ) {
                compressor.CompressStream( src, result );
                return result.ToArray();
            }
        }
And if I try to compress byte array greater than 30 MB then I get error:

Managed Debugging Assistant 'LoaderLock' has detected a problem in 'C:\Users...\Desktop\Test\Test\bin\Release\Test.vshost.exe'.

Additional information: Попытка выполнения управляемого кода под блокировкой OS Loader. Запуск управляемого кода в пределах функции DllMain или функции инициализации образа может вызвать зависание приложения.