Skip to content

Instantly share code, notes, and snippets.

View SimonCropp's full-sized avatar

Simon Cropp SimonCropp

View GitHub Profile
System.Threading.ThreadStateException : Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.
at System.Windows.OleServicesContext.SetDispatcherThread()
at System.Windows.OleServicesContext.get_CurrentOleServicesContext()
at System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
at ApprovalTests.Reporters.ClipboardReporter.Report(String approved, String received)
at ApprovalTests.Approvers.FileApprover.ReportFailure(IApprovalFailureReporter reporter)
at ApprovalTests.Core.Approvals.Verify(IApprovalApprover approver, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer, IApprovalNamer namer, IApprovalFailureReporter reporter)
at ApprovalTests.Approvals.Verify(IApprovalWriter writer)
at ApprovalTests.Xml.XmlApprovals.VerifyText(String text, String fileExtensionWithoutDot, Boolean safely)
@SimonCropp
SimonCropp / gist:4984933
Last active December 13, 2015 22:29
Full rebuild of NServiceBus with Nuget package restore (first) and Pepita package restore (second)
With Nuget.exe
Line 2173: 219 ms RestorePackages 1 calls
Line 8549: 162 ms RestorePackages 1 calls
Line 13958: 166 ms RestorePackages 1 calls
Line 16610: 433 ms RestorePackages 1 calls
Line 19297: 232 ms RestorePackages 1 calls
Line 22442: 162 ms RestorePackages 1 calls
Line 27069: 162 ms RestorePackages 1 calls
Line 29766: 160 ms RestorePackages 1 calls
There is at least one non-shared VCS root in this build configuration.
To move this build configuration attached VCS roots need to be shared
but you do not have enough permissions to share them. Move operation
is not possible.
public object ToDebugWithReturnAndTC(string param1, int param2)
{
try
{
throw new Exception("Foo");
}
finally
{
Debug.WriteLine("finally");
}
@SimonCropp
SimonCropp / gist:4214439
Created December 5, 2012 10:04
LogParamsOnException
Before
public class SimpleClass
{
[LogToDebugOnException]
void Method1(string param1, int param2)
{
//Do Stuff
}
Using
public class Log
{
public static Log With
{
get
{
throw new NotImplementedException();
}
public static class Log
{
public static void Debug(string message)
{
throw new NotImplementedException();
}
public static void Debug(string message, Exception exception)
{
throw new NotImplementedException();
}
public class ApplicationController
{
string myProperty;
public string MyProperty
{
get { return myProperty; }
set {
myProperty = value;
MyPropertyChanged(value);
}
@SimonCropp
SimonCropp / gist:3403640
Created August 20, 2012 12:18
internaltypeof
.method public hidebysig instance class [mscorlib]System.Type GetTypeInfoFromInternal() cil managed
{
.maxstack 8
L_0000: ldtoken [AssemblyToReference]InternalClass
L_0005: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
L_000a: ret
}
@SimonCropp
SimonCropp / gist:3236814
Created August 2, 2012 12:54
I think I will skip this one
100 Skips
20 bench
20 decline bench
20 incline bench
20 shoulder press
100 Skips
15 bench
15 decline bench
15 incline bench
15 shoulder press