Skip to content

Instantly share code, notes, and snippets.

View jbevain's full-sized avatar

Jb Evain jbevain

View GitHub Profile
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
internal struct FileVersionReader
{
private readonly PEReader _pe;
private BlobReader _reader;
public static Version? ReadFileVersion(PEReader pe)
{

Sebastian recently reported a scenario where an operation in Visual Studio took an unreasonable amount of time (15minutes) on a large Unity project (477 individual csproj in the solution).

Sebastian was kind enough to reach out and share a way to reproduce the issue.

What's happening

When all the projects of a Visual Studio solution are in an “unloaded” state.

Unloaded projects in the Solution Explorer
#if CS
using System.Runtime.InteropServices;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Managed");
var r = Compute(12, 12);
This file has been truncated, but you can view the full file.
class Program
{
static void F_0(int a) {}
static void F_1(int a) {}
static void F_2(int a) {}
static void F_3(int a) {}
static void F_4(int a) {}
static void F_5(int a) {}
static void F_6(int a) {}
static void F_7(int a) {}
using System.Net;
using Mono.Debugger.Soft;
using static System.Console;
static int PidToPort(int pid) => 56000 + (pid % 1000);
var pid = 49149; // process ID of the Unity Editor or the IL2CPP Game
var ip = IPAddress.Loopback; // IP where the Unity Editor/Game is running
using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
namespace UnityProjectExtractor
{
internal readonly struct PathMap
{
private readonly string _projectDirectory;
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using UnityEngine;
using UnityEditor;
#if ENABLE_VSTU
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using UnityEngine;
using UnityEditor;
#if ENABLE_VSTU
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
index e09132e2798..aa109ebd70d 100644
--- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
+++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
@@ -1786,6 +1786,11 @@ namespace Mono.Debugger.Soft
Send (CommandSet.VM, (int)CmdVM.STOP_BUFFERING);
}
+ internal VersionInfo VM_IsDeferred () {
+ var res = SendReceive (CommandSet.VM, (int)CmdVM.DEFERRED, null);
diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
index 05ab3fb..e55109f 100644
--- a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
+++ b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
@@ -94,7 +94,6 @@ static void ReadLocalVariables (MethodEntry entry, MethodBody body, Scope [] sco
void ReadLineNumbers (MethodEntry entry, InstructionMapper mapper)
{
- Document document = null;
var table = entry.GetLineNumberTable ();