首页 > 解决方案 > 错误 CS0103:当前上下文中不存在名称“资源”

问题描述

使用Xamarin,当我编译我的项目时,我得到一堆错误,就像标题中的错误一样。所有的错误错误都像这样在线发生:

LINE: var buttonLogin = FindViewById<Button>(Resource.Id.buttonLogin);
ERROR: error CS0103: The name 'Resource' does not exist in the current context

然而,这只是thrown通过compiler,代码没有下划线的语法问题,我也可以 f12Resource.Id.buttonLogin并找到为他的资源生成的代码。

代码工作并且看起来不错,但编译器不会停止抛出错误。

标签: androidxamarin

解决方案


推荐阅读