error CS0103 in ASP.NET

不打扰是莪最后的温柔 提交于 2019-12-20 06:36:38

问题


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.


回答1:


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.




回答2:


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.




回答3:


You forgot to add designer file to your code file.



来源:https://stackoverflow.com/questions/5119207/error-cs0103-in-asp-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!