EcoModKit icon indicating copy to clipboard operation
EcoModKit copied to clipboard

[9.5] Cannot attach debugger to release build server

Open MonzUn opened this issue 3 years ago • 12 comments

This is a modding specific bug/issue so I figured it should go here rather than the main EcoIssues tracker.

If you attempt to attach a debugger using Visual Studio to a server downloaded from Play.Eco, it gives the following error

"Unable to attach to CoreCLR. A debug component is not installed.

This started happening with 9.4 (maybe 9.3?) and is quite an issue for anyone who doesn't have dev tier and therefore can't build a server that will accept a debugger.

Both me and Nid encountered this issue and I've had it reported by other modders trying to extend DiscordLink now as well.

The way we do our setups is to set the eco server exe file as the target file to run hitting Run in Visual Studio in our plugin library projects.

MonzUn avatar Feb 17 '22 23:02 MonzUn

I remember this. I've been unable to reproduce it locally thus far. Attaching to a release server works when I try it. I'd need to know more details.

thetestgame avatar Feb 18 '22 02:02 thetestgame

My guess is that you have something in your development environment that fixes it. I know it can be hard to get a clean test environment for reproducing these kind of things ^^' I'll get back to you with a premade setup for DiscordLink so that it's quick and easy for you to test.

To me, it seems like any DLL project that runs the server exe and tries to attach a debugger will fail, if it's a release build of the server and it has been packaged for release via your build script. A regular local release build does not trigger the issue so I'm guessing something that's required for debugging gets stripped when you run your build script.

MonzUn avatar Feb 18 '22 11:02 MonzUn

Same exact Issue here. I can't attach the debugger to the EcoServer.exe.

On my Machine, this will occur every time, i try to attach. This can be reproduced by:

  1. Clean Visual Studio 22/ Visual Studio 19 Installation
  2. Create an empty Project
  3. Start EcoServer.exe
  4. Debug -> Attach to Process -> EcoServer.exe
  5. "Unable to attach the process. A debug component is not installed.

The error seen in the image below is slightly different from @MonzUn, however i'am getting the exact same error he does, when launching the Server via debug Configuration:

(launchSettings.json)

{
  "profiles": {
    "TitleModDebug": {
      "commandName": "Executable",
      "executablePath": "C:\\eco\\mods\\Eco\\Server\\EcoServer.exe",
      "workingDirectory": "C:\\eco\\mods\\TitleMod\\TitleMod\\bin\\Debug\\net5.0"
    }
  }
}

Version: 0.9.5.0-beta (https://play.eco/s3/release/EcoServerPC_v0.9.5.0-beta.zip) EcoServerPC_v0.9.5.0-beta.zip (SHA256): bc809c38e313f53581bd08c0b04227e3cd92e2af2f0463590c2b51f56f88c65c

Hopefully we can fix this.

image

JulianMa avatar May 01 '22 07:05 JulianMa

Have you guys tried with 9.6 develop/staging with .net 6?

redwyre avatar Jun 23 '22 13:06 redwyre

I haven't, but I'll try it out when I start updating my mods for 9.6, probably in a week or two.

MonzUn avatar Jun 26 '22 21:06 MonzUn

I will retry in the next few days

JulianMa avatar Jun 27 '22 06:06 JulianMa

I tested it again: I can't attach to v0.9.5.4-beta, however it works without any problems in the current v0.9.6.0-beta-staging-2339 build. So i think we can close this one.

JulianMa avatar Jul 06 '22 09:07 JulianMa

excellent, closing

redwyre avatar Jul 06 '22 16:07 redwyre

@redwyre This issue is back in the release version of 9.6. Can we reopen? @JulianMa ran into it again and here's someone else in your Discord having the same issue. https://discord.com/channels/254025510651297802/273246138835009548/1018300049022779462

MonzUn avatar Sep 11 '22 10:09 MonzUn

This issue is still present in 9.7.6. I used a fresh dev environment on a laptop that just had the OS installed today, so there shouldn't be any pollution in the environment.

image

MonzUn avatar Jan 06 '23 20:01 MonzUn

Tested under 9.7.8, error still present. Quite bothersome, modding without debugging isnt very convenient.

V0rag avatar Feb 12 '23 00:02 V0rag

Tested in Eco 10 in a fresh environment. Issue is still present.

MonzUn avatar Dec 28 '23 16:12 MonzUn