简体   繁体   English

立即窗口中的静态类方法

[英]Static Class Method in Immediate Window

If I have a class FilePathHandler which has a static method FormatSubPath and I breakpoint in my code is there a way to call this method either in the immediate window or watch window? 如果我有一个类FilePathHandler ,它有一个静态方法FormatSubPath和我的代码中的断点,有没有办法在即时窗口或监视窗口中调用此方法?

Usage; 用法;

var temp = FilePathHandler.FormatSubPath(path);

If I write the above in the Immediate window to test something on the fly during a breakpoint, I get the error "error CS0103: The name 'FilePathHandler' does not exist in the current context". 如果我在立即窗口中编写以上内容以在断点期间动态测试某些内容,则会收到错误“错误CS0103:当前上下文中不存在名称'FilePathHandler'”。 Is there anyway to do this or is it not possible? 无论如何要做到这一点还是不可能?

Try using with its complete namespace? 尝试使用其完整的命名空间? ie NameSpace.FilePathHandler.FormatSubPath(path); NameSpace.FilePathHandler.FormatSubPath(path);

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

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