且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当前上下文中不存在名称“xxx”

更新时间:2023-02-16 15:16:50

由于我找不到合适的解决方案,我将方法加载到文件中以便引用到.cs文件在本地,编译错误消失了。这绝对不是正确的解决方案,但可以帮助我避免暂时的头痛。感谢所有评论者。
Since I could not find the proper solution, I loaded the methods in the file to be referenced into the .cs file locally, the compiling error was gone. This is absolutely not proper solution, but can help me avoid the headache for the time-being. Thanks to all reviewers.


Make change your class type to static to access your static method public static void PrintWebControl(Control ctrl, string Script) 

public static class PrintHelper
{...
Because A static class can access a static method