Skip to content

Instantly share code, notes, and snippets.

The thread 0xc8c has exited with code 0 (0x0).
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in Microsoft.VisualStudio.Text.Data.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in Microsoft.VisualStudio.Platform.VSEditor.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>DefaultDomain</AppDomain><Exception><ExceptionType>System.ArgumentOutOfRangeException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Specified argument was out of the range of valid values.
Parameter name: span</Message><StackTrace> at Microsoft.VisualStudio.Text.SnapshotSpan..ctor(ITextSnapshot snapshot, Span span)
at Microsoft.VisualStudio
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
int oddNumbers = numbers.Count(n => n % 2 == 1);
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
var tree = CSharpSyntaxTree.ParseText(@"
public class MyClass
{
public void MyMethod()
{
}
}");
var tree = CSharpSyntaxTree.ParseText(@"
public class MyClass
{
public void MyMethod()
{
}
public void MyMethod(int n)
{
}
}");
var tree = CSharpSyntaxTree.ParseText(@"
public class MyClass
{
public void MyMethod()
{
}
public void MyMethod(int n)
{
}
}");
class SimpleClass
{
public void SimpleMethod()
{
}
}
@JoshVarty
JoshVarty / SimpleClass
Created July 11, 2014 17:31
Simple Class made up of Syntax Nodes and Tokens
class SimpleClass
{
public void SimpleMethod()
{
}
}
class SimpleClass
{
public void SimpleMethod()
{
}
}
public class ClassMethodWalker : CSharpSyntaxWalker
{
string className = String.Empty;
public override void VisitClassDeclaration(ClassDeclarationSyntax node)
{
className = node.Identifier.ToString();
base.VisitClassDeclaration(node);
}
public override void VisitMethodDeclaration(MethodDeclarationSyntax node)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Company.ProjectionBufferTutorial
{
public static class VisualStudioServices
{