简体   繁体   中英

How to enable intellisense on Xamarin.Android's AXML?

Since this great tool became free for everyone, I tried it, and I liked it especially Visual Studio Android emulator.

But, I got a problem because Visual Studio intellisense does not work at all for axml files.

I tried this article ( https://kb.xamarin.com/customer/portal/articles/1920119-how-do-i-enable-intellisense-in-android-axml-files- ) but those files (android-layout-xml.xsd, schemas.android.com.apk.res.android.xsd) does not exist in my PC

  1. Download this two files ( https://raw.githubusercontent.com/atsushieno/monodroid-schema-gen/master/schemas.android.com.apk.res.android.xsd and https://raw.githubusercontent.com/atsushieno/monodroid-schema-gen/master/android-layout-xml.xsd ) to "C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android" (if there is no such files there).
  2. Start "Developer Command Prompt for VS2015"
  3. Execute "devenv /resetsettings"
  4. Open *.axml file in your solution with "Open with" and select "Automatic editor selector (XML)" 自动编辑器选择器(XML)

  5. If intellisence still not working go to XML -> Schemas, add this schemas manually and restart visual studio.

  6. Enjoy! Intellisenseworks

The XSD files are located at C:\\Program Files (x86)\\Xamarin Studio\\AddIns\\MonoDevelop.MonoDroid\\schemas , note that this path exist when you install the Xamarin Studio.

I guess, we don't ship these files with Visual Studio plugin, I will have to confirm this with Xamarin.Android team.

Meantime you can find the schema files at https://forums.xamarin.com/discussion/comment/180685/#Comment_180685

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM