locked
CS0103 The name 'Resource' does not exist RRS feed

  • Question

  • User236903 posted

    In new version of xamarin with vs 2015 i get this message in every time i use resource.id

    Thursday, December 21, 2017 6:20 PM

All replies

  • User362297 posted

    I have the same. Xamarin 4.8.0.756. VS 2015.

    Wednesday, December 27, 2017 3:56 PM
  • User1151 posted

    Same problem here.

    Thursday, December 28, 2017 11:00 AM
  • User362297 posted

    There is no error if the project is generated in an earlier version of Xamarin.

    Friday, December 29, 2017 2:34 AM
  • User236903 posted

    What you mean earlier?can i downgrade?

    Friday, December 29, 2017 3:00 AM
  • User362297 posted

    Projects generated in the version published before November.

    Friday, December 29, 2017 9:22 AM
  • User236903 posted

    How can we avoid to install versions with bugs? Is there any way for downgrade in vs 2015?

    Friday, December 29, 2017 2:46 PM
  • User362297 posted

    The developers are silent.

    Saturday, December 30, 2017 4:04 AM
  • User208001 posted

    Clean and Rebuild projects

    Tuesday, January 2, 2018 7:50 PM
  • User236903 posted

    Didnt worked

    Wednesday, January 3, 2018 7:57 AM
  • User362297 posted

    Didnt worked too

    Wednesday, January 3, 2018 9:12 AM
  • User171749 posted

    Update your Xamarin.Forms package to the latest, but don't update the Android.Support ones, They will be updated automatically with the Xamarin.Forms package because of the dependencies.

    Wednesday, January 3, 2018 9:39 AM
  • User241053 posted

    Today I updated Xamarin for my Microsoft Visual Studio Community 2015 and I get the same problem. Until a month ago this problem did not arise.

    What happens is that I can build successfully the application and I can also deploy to my device without any problem, but when I write/edit the source code the error The name 'Resource' does not exist in the current context is always highlighted.

    The annoyance is that errors that do not exist are highlighted.

    My current configuration is:

    Xamarin 4.8.0.756 (64d469412) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer 4.8.188 (c5813fa34) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Xamarin.Android 8.1.0.13 (f241f51) Visual Studio extension to enable development for Xamarin.Android.

    Xamarin.Android SDK 8.1.0.23 (HEAD/f65f87747) Xamarin.Android Reference Assemblies and MSBuild support.

    [EDITED on 03/01/2018]

    I opened the bug report 61135

    Wednesday, January 3, 2018 2:47 PM
  • User155041 posted

    Hi @DimChris @locksmith

    Try adding Namespace before Resource , or try to add new activity and replace all content with your current activity

    Thursday, January 4, 2018 6:47 AM
  • User241053 posted

    Hello,

    I tried to add the Namespace before Resource but the problem persists...

    Thursday, January 4, 2018 9:09 AM
  • User155041 posted

    HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Thursday, January 4, 2018 9:17 AM
  • User241053 posted

    Hello,

    I tried to create a new Activity [i.e. MainActivityTBR] and replace the whole content with that of my current Activity [i.e. MainActivity] as suggested by @Charwaka

    I then cleaned the solution and I rebuilt it again.

    The recipe seemed to work.

    I then closed the solution and also VS. I restarted VS and opened the solution but the problem has reoccurred...

    Thursday, January 4, 2018 10:09 AM
  • User155041 posted

    @Stracandido said: Hello,

    I tried to create a new Activity [i.e. MainActivityTBR] and replace the whole content with that of my current Activity [i.e. MainActivity] as suggested by @Charwaka

    I then cleaned the solution and I rebuilt it again.

    The recipe seemed to work.

    I then closed the solution and also VS. I restarted VS and opened the solution but the problem has reoccurred...

    Try deleting *Resource.Designer.cs file ->Rebuild and check *

    **Change the project Deafult NameSpace like

    ClientApp->ClientApps->Rebuild and check**
    

    Try unloading & Reloading Resources Folder ->Rebuild and check

    Thursday, January 4, 2018 10:31 AM
  • User241053 posted

    @Charwaka said: HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Hi @Charwaka

    Intellisense does not provide any 'Droid' or 'droid' after ClientApp

    Thursday, January 4, 2018 10:45 AM
  • User155041 posted

    @Stracandido said:

    @Charwaka said: HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Hi @Charwaka

    Intellisense does not provide any 'Droid' or 'droid' after ClientApp

    is your project Name is "ClientApp.Droid" in the Solution Explorer ?

    Thursday, January 4, 2018 10:49 AM
  • User171749 posted

    Had this issue too many times. There is no point playing around with the Resource.Designer.cs file because it's generated at runtime so you will have to keep repeating the process to fix it. You need to use a different Xamarin.Forms package and that will tend to fix it for me, also close Visual Studio and reopen it.

    Thursday, January 4, 2018 10:53 AM
  • User241053 posted

    @Charwaka said:

    @Stracandido said:

    @Charwaka said: HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Hi @Charwaka

    Intellisense does not provide any 'Droid' or 'droid' after ClientApp

    is your project Name is "ClientApp.Droid" in the Solution Explorer ?

    The project name is ClientApp as well as the Namespace

    The project was created a couple of years ago (with that name and that namespace) and only now, after installing the latest version of Xamarin 4.8.0.756, the problem occurs.

    Thursday, January 4, 2018 11:10 AM
  • User155041 posted

    @Stracandido said:

    @Charwaka said:

    @Stracandido said:

    @Charwaka said: HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Hi @Charwaka

    Intellisense does not provide any 'Droid' or 'droid' after ClientApp

    is your project Name is "ClientApp.Droid" in the Solution Explorer ?

    The project name is ClientApp as well as the Namespace

    The project was created a couple of years ago (with that name and that namespace) and only now, after installing the latest version of Xamarin 4.8.0.756, the problem occurs.

    First try like this

    ClientApp.Resource

    if dont work try following steps

    **Change the project Deafult NameSpace like

    ClientApp->ClientApps->Rebuild and check** Try unloading & Reloading Resources Folder ->Rebuild and check

    Thursday, January 4, 2018 11:14 AM
  • User155041 posted

    @seanyda said: Had this issue too many times. There is no point playing around with the Resource.Designer.cs file because it's generated at runtime so you will have to keep repeating the process to fix it. You need to use a different Xamarin.Forms package and that will tend to fix it for me, also close Visual Studio and reopen it.

    not in every case

    Thursday, January 4, 2018 11:14 AM
  • User241053 posted

    @Charwaka said:

    @Stracandido said:

    @Charwaka said:

    @Stracandido said:

    @Charwaka said: HI @Stracandido @DimChris @locksmith

    Check for intellisense with Droid or droid name after ClientApp

    Let say you project structure will be

    ClientApp.Portable ClientApp.Droid ClientApp.iOS

    Then you should use

    ClientApp.Droid.Resource

    Hi @Charwaka

    Intellisense does not provide any 'Droid' or 'droid' after ClientApp

    is your project Name is "ClientApp.Droid" in the Solution Explorer ?

    The project name is ClientApp as well as the Namespace

    The project was created a couple of years ago (with that name and that namespace) and only now, after installing the latest version of Xamarin 4.8.0.756, the problem occurs.

    First try like this

    ClientApp.Resource

    if dont work try following steps

    **Change the project Deafult NameSpace like

    ClientApp->ClientApps->Rebuild and check** Try unloading & Reloading Resources Folder ->Rebuild and check

    Hi @Charwaka

    I've already tried to put the Namespace [ClientApp] before Resource but without success.

    I changed the Namespace from ClientApp to ClientApps, I changed also the Default Namespace from ClientApp to ClientApps, so I deleted the file Resource.Designer.cs, cleaned the solution and then rebuilt everything by adding the new regenerated file Resource.Designer.cs in the Resource folder.

    I successfully deleted the Resources folder from the project. I cleaned the solution then I closed the project and I restarted VS.

    I copied a copy of the same folder into the project tree and I included it again in the project.

    I rebuilt everything but the problem persists...

    Thursday, January 4, 2018 12:58 PM
  • User236903 posted

    I made a clean install of Visual Studio and xamarin in default install version and problem solved.

    Thursday, January 4, 2018 4:01 PM
  • User364287 posted

    Same exact problem as others in here and has ground things to a near halt. Adding namespace identifiers in the code itself doesn't change anything because the resources class uses the default app namespace. I also got this when updating Xamarin tools this week. The process is hideous - make changes, do a build, run it - everything works. As soon as it's run once, then the Resource class can no longer be found...even if you do absolutely nothing else, like not a single keystroke. Then you can clean the project and try to rebuild it, and every now and then it will fix it, but many times now it doesn't. The only cure has been to close Visual Studio, restart, reload the project, do a clean, and rebuild. Every single time I make changes. This is totally unsustainable.

    Friday, January 5, 2018 12:30 AM
  • User236903 posted

    I think its xamarin's bug. Probably it will be fixed in a new version. If someone from developers knows any way for fixing our problem please let us know.

    Sunday, January 7, 2018 10:12 PM
  • User362297 posted

    I tried using the installer to fix the problem. Did not help.

    Monday, January 8, 2018 5:21 AM
  • User241053 posted

    @DimChris said: I think its xamarin's bug. Probably it will be fixed in a new version. If someone from developers knows any way for fixing our problem please let us know.

    Me too...

    In fact I opened this public bug report 61135 a week ago

    Monday, January 8, 2018 9:55 AM
  • User241053 posted

    I removed Microsoft Visual Studio Community 2015 [and whole Xamarin Tools] and installed Microsoft Visual Studio Community 2017 successfully.

    Microsoft Visual Studio Community 2017 Version 15.5.2 VisualStudio.15.Release/15.5.2+27130.2010 Microsoft .NET Framework Version 4.7.02053

    Xamarin 4.8.0.753 (6575bd113) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer 4.8.188 (c5813fa34) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    I opened my project that highlighted the problem by discovering that with this new version of the IDE the problem has disappeared.

    I think it's a bug of Xamarin in this configuration:

    Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3 Microsoft .NET Framework Version 4.7.02053

    Xamarin 4.8.0.756 (64d469412) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer 4.8.188 (c5813fa34) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Tuesday, January 9, 2018 4:49 PM
  • User364464 posted

    Facing the same issue

    Microsoft Visual Studio 2015 Version 14.0.25421.03 Update 3 Microsoft .NET Framework Version 4.6.01038

    Xamarin 4.8.0.756 (64d469412)

    Xamarin Designer 4.8.188 (c5813fa34)

    Xamarin.Android 8.1.0.13 (f241f51) Xamarin.Android SDK 8.1.0.23 (HEAD/f65f87747)

    Any workaround or fix for Visual Studio 2015

    Wednesday, January 10, 2018 9:13 AM
  • User7993 posted

    Experiencing this also. Got nothing done for two days.

    Friday, January 19, 2018 9:59 AM
  • User364667 posted

    Any change in bugs occurred in visual studio 2015 ??????

    Tuesday, January 23, 2018 11:10 AM
  • User236903 posted

    No yet last version 4.8.0.756 still have this issue

    Tuesday, January 23, 2018 8:39 PM
  • User283586 posted

    I'm using Visual Studio for Mac version 7.3.3 and I have the same issue

    Tuesday, January 30, 2018 9:39 AM
  • User27033 posted

    So I had a number of issues (see my other post) and I installed VS Preview, and loaded it up, build a new project and it worked!

    Joyfully I made my simple project then tried to change my Namespace to something more appropriate it was (XamDeleteMe) . That killed it.

    So I made a new project, copied over the code, piece by piece building it as it went. and it failed with CS0103: The name 'Resource' does not exist in the current context

    Nothing I can do has changed it. New project, new VS, still doesn't post. It seems to me that there is a second place that the Resource is moved to on build and in that place there is not a link to the resource designer, because there is no error until you build it.

    It seems nothing to do with what we can work with, but something behind the scenes in the build process is broken.

    Sunday, May 13, 2018 12:25 AM
  • User27033 posted

    I made a new project cut and pasted my code across again. built it every time. It worked. Then I added 2 buttons to the bottom of the activity. It died. Back to the same error.

    Delete the buttons out, it works. Add them in again, it works. Totally random ......

    Sunday, May 13, 2018 3:02 AM
  • User236903 posted

    This problem has been fixed in new xamarin's version. The problem i have now is that i'm getting blank screen on layout designer https://forums.xamarin.com/discussion/123159/layout-black-screen#latest

    Monday, May 14, 2018 8:19 AM
  • User288417 posted

    I'm having this same issue with everything up to date as of today, I don't think it's fixed.

    Wednesday, June 13, 2018 7:35 PM
  • User236903 posted

    No it isn't fixed yet. Maybe in a future xamarin's version.

    Thursday, June 14, 2018 5:31 AM
  • User356285 posted

    Anyone know of a fix for this?

    Thursday, June 28, 2018 9:01 PM
  • User236903 posted

    I think it has fixed in latest vs2017 latest released

    Thursday, June 28, 2018 9:12 PM
  • User367133 posted

    Is not fixed yet. I'm able to build and deploy the project in my case but that error is simply annoying.

    Tuesday, July 31, 2018 4:28 AM
  • User236903 posted

    Try an older xamarin version.

    Tuesday, July 31, 2018 5:23 AM
  • User278404 posted

    I'm facing same issue. I'm using latest version of VS for MAC (7.6.10). Anyone found solution?

    Friday, October 26, 2018 1:16 PM
  • User155041 posted

    @"SnehalJadhav.0403" said: I'm facing same issue. I'm using latest version of VS for MAC (7.6.10). Anyone found solution?

    have you tried these steps

    Clean the solution Build each project one at at time from the top, down Then Rebuild solution Then run -(if not working)

    Paste Entire Output Log Here

    Friday, October 26, 2018 1:41 PM
  • User365142 posted

    @Charwaka said:

    @"SnehalJadhav.0403" said: I'm facing same issue. I'm using latest version of VS for MAC (7.6.10). Anyone found solution?

    have you tried these steps

    Clean the solution Build each project one at at time from the top, down Then Rebuild solution Then run -(if not working)

    Paste Entire Output Log Here

    Yeah, I tried that, and it didn't work. Resolution for me was backing up to an old version of my app and copy pasting code from the newer one into the old buildable version. Luckily, I've got 20 versions saved.

    This resources bug seems pretty prominent. ... I haven't downloaded the latest update though. Need to do that

    Friday, October 26, 2018 2:51 PM
  • User236903 posted

    The problem has been fixed in newer xamarin's editions. I tried version vs2017 15.8.5. Everything is working fine!

    Friday, October 26, 2018 8:26 PM
  • User278404 posted

    @Charwaka , I tried the same but its not working. Please check attached build log. I'm using VS for MAC latest version 7.6.10

    Friday, November 2, 2018 7:19 AM
  • User155041 posted

    @"SnehalJadhav.0403" said: @Charwaka , I tried the same but its not working. Please check attached build log. I'm using VS for MAC latest version 7.6.10

    i can see build succeed here , i am not getting whats exactly your problem now ?

    Friday, November 2, 2018 1:26 PM
  • User381300 posted

    I have been suffering this problem since a long time ago across different Visual Studio and Xamarin versions... Last time I solved it by closing VS and then deleting the ".vs" folder of the project. Once the solution was reopened everything was fine. Hope it helps someone. They should really fix it, it has been like this long enough.

    Tuesday, January 8, 2019 10:06 AM
  • User382282 posted

    i am using VS2015 after i had update xamarin to new version it appears!!

    Thursday, February 7, 2019 8:17 PM
  • User236903 posted

    I think that xamarin has long time that it doesn't make updates for vs 2015. Just go in vs 2017 last edition. They have fix most of the bugs.

    Friday, February 8, 2019 10:46 AM
  • User365576 posted

    I had this issue, in my case I accidentally changed the BUILD ACTION for the Resource.Designer.cs to something other than COMPILE. I changed it back and now it works just fine. Maybe it helps someone...

    Sunday, March 3, 2019 6:48 PM
  • User365813 posted

    @LewXam said: I had this issue, in my case I accidentally changed the BUILD ACTION for the Resource.Designer.cs to something other than COMPILE. I changed it back and now it works just fine. Maybe it helps someone...

    Yes, very clever solution! Worked for me! Cheers!

    Tuesday, November 26, 2019 2:43 PM