Xamarin-android: Intellisense can't recongize 'Resource.Dimension' definition

Created on 7 Jun 2018  路  1Comment  路  Source: xamarin/xamarin-android

Description

I created some 'Resource.Dimension' resource but Visual Studio 2017 intellisense can't recongize it. Underline all dimension resources in my cs code with the error:

 `Resource.Dimension` does not contain a definition for...

Intellisense offer me only standard dimensions properties.

Steps to Reproduce

  1. Create a blank Xamarin.Android project

  2. Add dimens value in Resources\values\dimens.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <dimen name="fab_margin">16dp</dimen>

  <dimen name="main_text_item_size">17dp</dimen>
</resources>

  1. Use it in MainActivity:
var a = Resources.GetDimension(Resource.Dimension.fab_margin);

a

Expected Behavior

Without intellisense error

Actual Behavior

Has intellisense error but could run application without a problem and problem persists.

Basic Information

  • IDE: VS 2017 15.7.2
  • Platform Target Frameworks:
  • Android: Android Target Version: 27
  • Android Support Library Version: the latest version: 27.0.2

Tried clean solution, delete bin&obj folder, problem exists. And I could found Resource.Dimension resource in Resource.Designer.cs file:

2

Screenshots

a

VS bug #628467

Design-Time Build bug vs-sync

Most helpful comment

@jonpryor , in which version of Xamarin.Android this bug will be fixed? :)

>All comments

@jonpryor , in which version of Xamarin.Android this bug will be fixed? :)

Was this page helpful?
0 / 5 - 0 ratings