Luke Vo
Luke Vo

Reputation: 20748

How do I correctly use Attach to Process to debug my C# DLL in a Unity game? (No Unity IDE involved)

I am making mods for a game made with Unity. They are compiled using netstandard2.1, Class Library project type. The game then dynamically loads those mods' DLL files. I code it using Visual Studio only and no Unity involved or even installed.

However, when using VS' Attach to Process feature, the breakpoints don't hit. I have checked:

<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>

The only difference I can see is: when attaching to my test ConsoleApp, the Code type would be Automatic: Managed, but when attaching to the game's process, it says Automatic: Native. So I assume maybe Unity or Mono did something to the game so my DLL is no longer recognizable by VS. I did manually change it to Managed as well but it didn't hit still.

enter image description here

What could be the issue here? How do I debug my mods?

Upvotes: 0

Views: 68

Answers (0)

Related Questions