I'm using Visual Studio 2015 with Xamarin.Android. My solution compiles and links fine, with no warnings or errors. It runs correctly on my target device.
However, Intellisense can't find the autogenerated Resource.designer.cs file (which provides all the resource ID constants for things like page design elements from .axml files, string resources, assets and so on).
If I have code like: var button = FindView(Resource.Id.some_button);, then in the edit window the "Resource" part will have a red underline, and if I mouse over it, I see: "The name 'Resource' does not exist in the current context."
In the Output window, if I change the dropdown to show output from Intellisense, I see a line like:
[Failure] Could not find file 'C:\Users\dghenke\Downloads\Widget\Widget\Widget.Android\obj\Debug\designtime\Resource.Designer.cs'.
That path exists up to the Debug\ folder, but there is no designtime\ folder underneath.
Things I have tried:
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
is in the first <PropertyGroup> element.Resource.designer.cs file from the project and re-adding it.Things I have not tried (and would prefer to keep it that way): Creating a whole new solution from scratch then manually re-adding all my source files from the original.
Versions:
What finally worked for me was addding:
<AndroidUseManagedDesignTimeResourceGenerator>False</AndroidUseManagedDesignTimeResourceGenerator>
to the first PropertyGroup in my .csproj file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With