ASP.NET 中的错误 CS0103
您好,当我使用文件 Microsoft.NET\Framework\v2.0.50727\MSBuild.exe 编译 ASP.NET C# 项目时,出现错误“错误 CS0103:在当前上下文中找不到名称(表单名称)
”对于我使用 ASP.NET 表单的每个位置,都会单独显示错误。
Hello when I compile a ASP.NET C# project using file Microsoft.NET\Framework\v2.0.50727\MSBuild.exe I am getting an error as "ERROR CS0103: The name (forms name) cannot be found in the current context"
This error is displayed individually for every where I use ASP.NET forms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
中所示
如 MSDN 使用类、命名空间或作用域中不存在的名称。检查名称的拼写并检查您的 using 语句和程序集引用,以确保您尝试使用的名称可用。 一个常见的错误是在循环或 try 块中声明变量,然后尝试从封闭的代码块或另一个代码块访问它。
As seen in the MSDN
An attempt was made to use a name that does not exist in the class, namespace, or scope. Check the spelling of the name and check your using statements and assembly references to make sure that the name you are trying to use is available. One common mistake is to declare a variable within a loop or a try block and then attempt to access it from an enclosing code block or another code block.
使用compile.bat 文件编译所有文件并确保包含设计器文件。仅当上下文中不存在设计器文件时才会发生此错误。
Use compile.bat file to compile all the files and make sure that designer files are included. This error occurs only when designer file is not present in the context.
您忘记将设计器文件添加到代码文件中。
You forgot to add designer file to your code file.