简体   繁体   中英

Debug.WriteLine command does not appear any output

I have .Net project as nuget package. I am creating new project and adding this package to my new project. Nuget package project has Debug.WriteLine commands but I do not see any ouput in new project's console when project run on Debug mode.

is there any setting to enable that in Visual Studio 2019?

Thank you in advance.

The libraries (*.dll files) you got and are using from the nuget packages are most probably compiled in a Release configuration. So regardless of the package code having Debug.WriteLine methods these methods were omitted while compiling and are not present in the running code.

If you want to see the Debug.WriteLine outputs from the packages (actually rarely needed), than you have either to find a Debug build binary of the packages or to get the code and build it yourself in the Debug configuration, than use the resulting binaries.

Restoring nugets in a specific configuration, but not sure if it works: nuget restore with configuration

The following might also be related and help you: debugging-nuget-package

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM