无法在Mono(Xamarin Studio)中重新生成Resource.designer.cs [英] Resource.designer.cs NOT regenerating in Mono (Xamarin Studio)
问题描述
我目前正在使用Mono开发应用程序,最近更新到Xamarin Studio 4.0.8,并且在未将设计元素添加到解决方案中时遇到了问题.
I'm currently developing an app with Mono, I recently updated to Xamarin Studio 4.0.8, and was having problems with the design elements not being added to the solution.
我尝试手动编辑designer.cs,后来删除了它,希望程序会随着布局的更改再次重新生成它.
I tried to edit manually the designer.cs, and later on I erased it, hoping the program will regenerate it again, with the layout changes.
我尝试过:
-
重建
Rebuilding it
清洁和重建
通过文件浏览器删除文件
Erasing the file through the file explorer
它仍然不能正确地重新生成,Xamarin创建了Resource.designer.cs,但是它是空的,并且在编译时返回以下内容:
And it still doesn't regenerate properly, Xamarin creates the Resource.designer.cs but it's empty, and when compiling it returns this:
Error CS0103: The name 'Resource' doesn't exist in the current context (CS0103)
请帮助...
推荐答案
很多时间出现此问题.我做了什么:
Lots of time having this issue. What i did:
- 使用Xamarin删除"resources.designer.cs"(第二按钮->删除).
- 转到命令行(在Mac上为finder/在Windows上为Explorer),然后手动删除文件(确保已将其删除).
- 转到Xamarin,清除->构建(这将重新生成resoruces.designer.cs).
- 从项目中删除文件时,必须再次添加它.项目上的第二个按钮->添加文件->选择Resources.designer.cs(通常在/Resources文件夹上).
- 确保Resource.designer.cs文件的构建操作"为编译"(有时默认情况下会采取其他构建操作).
- 清理并构建.
至少在大多数情况下都有效.
At least it have worked most of the time.
这篇关于无法在Mono(Xamarin Studio)中重新生成Resource.designer.cs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!