Finding current directory during Visual Studio debugging session?

前端 未结 3 1830
太阳男子
太阳男子 2020-12-17 10:23

How can I find the current directory for a .NET application running under the Visual Studio debugger?

Update 1. To be clear: I don\'t want to change

3条回答
  •  鱼传尺愫
    2020-12-17 10:55

    In Visual Studio, under the project's settings in the debug tab, you can set the "Working Directory" if you want.

    To determine the current working directory in code or in the immediate window in a breakpoint, try

    System.IO.Directory.GetCurrentDirectory()
    

提交回复
热议问题