简体   繁体   English

C# 代码在 Visual Studio 2015 但不是 2013 中显示错误

[英]C# code shows error in visual studio 2015 but not 2013

I've got ac# project that was coded in Visual Studio 2010. The code runs without any errors.我有一个在 Visual Studio 2010 中编码的 ac# 项目。代码运行时没有任何错误。 If I open the project in Visual Studio 2015 (Community Edition) it shows error any idea.如果我在 Visual Studio 2015(社区版)中打开该项目,它会显示任何想法错误。

UpdateControls(false);
UpdateControls(true);

Project code in age:项目代号:

在此处输入图片说明

As your error message explicitly states :正如您的错误消息明确指出:

The name 'UpdateControls' does not exist in the current context.当前上下文中不存在名称“UpdateControls”。

If you manually performed this migration, it's likely that you simply neglected to copy over your UpdateControls() method.如果您手动执行此迁移,很可能您只是忽略了复制UpdateControls()方法。 You should consider double-checking through your updated Project to see if it is actually missing.您应该考虑仔细检查更新后的项目,看看它是否真的丢失了。

If it is included within the project, then ensure that it has the proper access modifiers and it is able to be accessed (ie in the proper namespace, etc.).如果它包含在项目中,则确保它具有正确的访问修饰符并且能够被访问(即在正确的命名空间等中)。

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

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