Skip to content

Instantly share code, notes, and snippets.

View EgorBo's full-sized avatar
🛠️
Working from home

Egor Bogatov EgorBo

🛠️
Working from home
View GitHub Profile
@EgorBo
EgorBo / GlobalField bug.cs
Created September 8, 2017 13:47
GlobalField bug.cs
using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
namespace MyConsoleHelper
{
class Program
{
static void Main(string[] args)
@EgorBo
EgorBo / ConstantField bug.cs
Created September 8, 2017 13:49
ConstantField bug.cs
using System;
using System.Linq.Expressions;
using System.Reflection;
namespace MyConsoleHelper
{
class PropertyAndFields
{
public string StringProperty { get; set; }
public string StringField;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Linq;
using Xunit;
namespace MegaTests
{
public class SuperTests
[Flags]
public enum TargetFrameworkMonikers
{
Net45 = 0x1,
Net451 = 0x2,
Net452 = 0x4,
Net46 = 0x8,
Net461 = 0x10,
Net462 = 0x20,
Net463 = 0x40,
using System.Threading;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
var t = new Thread(() => { });
t.IsBackground = true;
using System;
using System.Threading;
namespace ConsoleApplication
{
internal class Program
{
public static void Main(string[] args)
{
Console.WriteLine(new ThreadInterruptedException().Message);
using System.Threading;
namespace ConsoleApplication
{
internal class Program
{
public static void Main(string[] args)
{
var t = new Timer(new TimerCallback(_ => { }), null, 1, 1);
t.Dispose();
using System.Threading;
namespace ConsoleApplication
{
internal class Program
{
public static void Main(string[] args)
{
var t = new Timer(new TimerCallback(_ => { }), null, 1, 1);
t.Dispose();
using System;
using System.Threading;
namespace ConsoleApplication
{
internal class Program
{
public static void Main(string[] args)
{
var maxThreads = 0x7fff;
// each line throws NotSupported/NotImplemented exceptions:
//1
CompressedStack compressedStack = CompressedStack.Capture();
//2
Thread.CurrentThread.DisableComObjectEagerCleanup();