3

I have Build set to Release mode.

enter image description here

I'm running my .NET Core 3.1 Console App with Benchmark DotNet. But it tells me, that

Summary -> Benchmark was executed with attached debugger

How to turn off debugger completely in Release build mode?

Broots Waymb
  • 4,713
  • 3
  • 28
  • 51
michasaucer
  • 4,562
  • 9
  • 40
  • 91

2 Answers2

8

Debug -> Start Without Debugging (Ctrl+F5)

Screenshot of "Start Without Debugging"

canton7
  • 37,633
  • 3
  • 64
  • 77
  • Still, `Benchmark` tells me, that im running my app in `debug` mode – michasaucer Jan 30 '20 at 21:21
  • @michasaucer What *exactly* does it tell you? What's the exact message? – canton7 Jan 30 '20 at 21:21
  • After all tests, its print that `Summary` from my original post – michasaucer Jan 30 '20 at 21:23
  • 1
    @michasaucer So it tells you that you've got an attached debugger, *not* that you're running your app in `debug` mode? (Those are two very different things) – canton7 Jan 30 '20 at 21:23
  • I think so. Where can i find that `attached` property in my app? For debugger of course – michasaucer Jan 30 '20 at 21:27
  • What do you mean, `attached` property? Your app can be built in a Debug or Release configuration: Debug builds are slower, but are easier to debug (*if* you attach a debugger to them); Release builds are quicker, but harder to debug. You can run both Debug and Release builds. When one is running, you can choose to attach a debugger (regardless of whether it's a Debug or Release build). When you click "Start Debugging", Visual Studio will start your application and then attach a debugger. When you click "Start Without Debugging", Visual Studio just starts your application: no debugger. – canton7 Jan 30 '20 at 21:31
2

You can just run it from command line:

dotnet run -c Release
Adam Sitnik
  • 1,256
  • 11
  • 15