Resourse.designer.cs 无法重建 android Xamarin? [英] Resourse.designer.cs can't rebuild android Xamarin?

查看:27
本文介绍了Resourse.designer.cs 无法重建 android Xamarin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我正在尝试使用 Xamarin 开始在 C# 中为 Android 编程.但是,当我转到他们的文档并按照示例播放音频时(这里是音频文档的链接).当我添加这行代码时:

Today I am trying to make a start in programming for Android in C# using Xamarin. However, when I go to their docs and follow an example to play audio (Here is the link to the audio docs). When I add this line of code:

    _player = MediaPlayer.Create(this, Resource.Raw.test);

我收到此错误:

    E:\Android Apps\Hardcore_Gabber_App\HardcoreGabberApp\MainActivity.cs(48,48): Error CS0117: 'HardcoreGabberApp.Resource' does not contain a definition for 'Raw' (CS0117) (HardcoreGabberApp)

这就是我的文件夹:

它仍然无法找到Raw".删除 Recourse.designer.cs 然后重建不起作用.然后我收到更多错误并且 Recourse.designer.cs 没有重建.我该如何解决这个问题?

And still it cant find "Raw". Deleting the Recourse.designer.cs and then rebuild is not working. Then I am getting even more errors and the Recourse.designer.cs is not rebuilding. How can I fix this?

推荐答案

看来我必须通过在文件夹上添加右键单击并按添加文件而不是拖放来手动添加文件来解决问题:

It seemed that I had to add the files manually by adding right clicking on a folder and press add files instead of drag and drop to fix the issue:

这篇关于Resourse.designer.cs 无法重建 android Xamarin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆