The name 'Resource' does not exist

DavidLLLDavidLLL Member
edited October 2018 in Xamarin.Android

I have just created a project using visual studio 2015 enterprise. Seeing the code indicates an error in red lines but at the time of compiling it says that supposedly there are no errors but I know that if I start programming and adding lines of code at some point it will send me errors. Could anyone help me please ?

Answers

  • eubikeubik Member ✭✭

    Have you tried cleaning everything and then building it again? Or manually deleting your bin and obj folders and then building again?

    Also, although I am using visual studio 2017, I have found that when in debug mode if I'm cleaning/building/deploying with c# files open in the main window, it'll throw some weird errors. For me it's usually App() or InitializeComponent() does not exist. Not sure if what I suggested will help you, but it helped me with seemingly random errors.

  • jezhjezh Member, Xamarin Team Xamurai

    Could you try to delete the bin folders and the obj folders and rebuild it ? If it doesn’t work ,try to restart the VS .

  • hexagodhexagod Member ✭✭✭

    I've had this same problem.. it's extremely annoying. My best advice to you, using xamarin, is to make archive copies ALL THE TIME.. every hour or so make a copy. One of the most frustrating things about Xamarin is that it will randomly throw errors like this and then I have to back up to an old project. I've seen this exact same thing when I had changed nothing in the actual project that would remove the reference and all the sudden the project won't compile.

    Another thing, 2015.... you should be using 2017 with every package and update installed if you're going to be using xamarin.

  • hexagodhexagod Member ✭✭✭

    @jezh said:
    Could you try to delete the bin folders and the obj folders and rebuild it ? If it doesn’t work ,try to restart the VS .

    that's not a bad idea. seeing as how I've seen this problem occur after debugging.

  • hexagodhexagod Member ✭✭✭

    @eubik said:
    Have you tried cleaning everything and then building it again? Or manually deleting your bin and obj folders and then building again?

    Also, although I am using visual studio 2017, I have found that when in debug mode if I'm cleaning/building/deploying with c# files open in the main window, it'll throw some weird errors. For me it's usually App() or InitializeComponent() does not exist. Not sure if what I suggested will help you, but it helped me with seemingly random errors.

    not bad advice but this won't work for the error he's getting. I had the same error and tried that to no avail.

  • hexagodhexagod Member ✭✭✭

    ^^(simply cleaning the project) .. I hadn't tried deleting obj and bin ... that actually might work.
    also, why can we not edit our posts on here? I have to spam to make corrections

  • hexagodhexagod Member ✭✭✭

    Someone told me how to fix this over the weekend and it worked. Find the resource.designer.cs inside layout. Make a backup of the file, and then delete it. Clean the solution, then rebuild, the file will re-appear but you need to re-add it into the project using right click > add > add existing item. Then clean and rebuild again.

Sign In or Register to comment.