Skip to content Skip to sidebar Skip to footer

Xamarin Resource.designer.cs Not Refreshing New Id's Or Events

So im working in Xamarin and i had a problem with my events and layouts because i added new stuff but the layouts didn't refresh they just kept displaying the old layouts and the n

Solution 1:

It's happening to me all the time in VS2017, the trick is to re-add "MSBuild:UpdateGeneratedFiles" in the "Custom Tool" property of your layout.

Solution 2:

Project Clean & rebuild the solution/project normally solves the issue.

Usually this condition is seen if you have build/compile issues with your code, axml, etc.. and thus the generated-code/code-behind file can not be created.

If you can reproduce this issue, I would highly recommend adding to this open issue:

Note: You can also try the current alpha/beta cycle release if you can not currently on that release channel

Solution 3:

Ok first of all thanks everyone for your help and the problem was only happenign to one of my layouts (Login) the other ones were updating just fine this problem was happening because i imported this layout from another solution i did earlier that had a problem with a .gif file and deleted a few files from that 1º solution i created another layout and its working fine thanks everyone.

Solution 4:

I'm having the same issue: this is the official Xamarin answer (which isn't particularly great for people unable to update to version 5.0 +):

https://developer.xamarin.com/guides/android/troubleshooting/questions/resource-designer-wont-update/

Options:

1) Manually edit your .csproj file (eww)

2) Create a brand new project and copy your resources (disgusting)

3) Update.

I wish I could be more helpful...

Solution 5:

Usually, simply modifying anything in Android Resources will rebuild the Resource.Designer.cs file e.g. changing a view id in a layout.

In my case I changed a file name in resource/layout dir. This caused an error in my .csproj where the filename was changed in the file system but the .csproj was still referencing the old name.

This caused the Android Resource.Designer generator to fail with no obvious reason. Once I removed the stale reference from my Android .csproj file and added the proper one, the Resource.Designer was generated successfully.

Post a Comment for "Xamarin Resource.designer.cs Not Refreshing New Id's Or Events"