简体   繁体   English

Debug.WriteLine 命令没有出现任何输出

[英]Debug.WriteLine command does not appear any output

I have .Net project as nuget package.我有 .Net 项目作为 nuget 包。 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. Nuget 包项目具有Debug.WriteLine命令,但当项目在调试模式下运行时,我在新项目的控制台中看不到任何输出。

is there any setting to enable that in Visual Studio 2019?是否有任何设置可以在 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.您从 nuget 包中获得和使用的库(*.dll 文件)很可能是在发布配置中编译的。 So regardless of the package code having Debug.WriteLine methods these methods were omitted while compiling and are not present in the running code.因此,无论包代码是否具有 Debug.WriteLine 方法,这些方法在编译时都被省略了,并且不会出现在运行代码中。

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.如果您想查看包中的 Debug.WriteLine 输出(实际上很少需要),那么您必须找到包的 Debug 构建二进制文件或获取代码并在 Debug 配置中自己构建它,而不是使用结果二进制文件。

Restoring nugets in a specific configuration, but not sure if it works: nuget restore with configuration在特定配置中恢复 nugets,但不确定它是否有效: nuget restore with configuration

The following might also be related and help you: debugging-nuget-package以下内容也可能与您相关并可以帮助您: debugging-nuget-package

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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