Can't start debugging in Visual Studio 2019

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Yagiza
Posts: 120
Joined: Wed Jul 31, 2019 5:16 pm

Can't start debugging in Visual Studio 2019

Post by Yagiza »

Trying to attach debugger of Visual Studio 2019 to Unity Editor. When I press "Run", it starts building and I get these error messages:

Code: Select all

1>CSC : error CS2007: Нераспознанный параметр: "/analyzerconfig:H:\workspace\DaggerfallUnity\daggerfall-unity\.editorconfig"

Code: Select all

3>CSC : error CS2007: Нераспознанный параметр: "/analyzerconfig:H:\workspace\DaggerfallUnity\daggerfall-unity\.editorconfig"

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Can't start debugging in Visual Studio 2019

Post by Interkarma »

I use VS2019 Pro and haven't encountered any issues attaching debug. Just a few possibilities off the top of my head:
  • Check that you're opening project from a clean download of source using Unity 2019.4.10f1 (specifically this version at time of writing).
  • For mod creation, best to download the tagged release matching the current live build. Master branch can be ahead of releases and contain breaking changes if mods are built against it then run in live builds.
  • When setting up VS for the first time, you can select to install the debugging tools for Unity. Check these are installed to VS using Tools > Get Tools & Features. Under Gaming, check that "game development with Unity" is selected.
  • In the Unity editor, go to Edit > Preferences > External Tools and check that "Visual Studio 2019 (Professional)" (or whatever version you have) is selected as the code editor.
  • In case you're using VS Code as opposed to full Visual Studio, I seem to recall there was an issue with debugging a few months back. I don't have any specifics, but I found this forum post. Even if this doesn't apply here, it might help someone else finding this topic later.

User avatar
joshcamas
Posts: 87
Joined: Mon Sep 21, 2020 7:01 am

Re: Can't start debugging in Visual Studio 2019

Post by joshcamas »

I believe debugging cannot work with mods, since you're not running the c# files directly, but using the runtime compiler

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Can't start debugging in Visual Studio 2019

Post by Hazelnut »

You can debug mods as long as you run them as virtual mods, and not a built dfmod on /mods folder.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply