且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xamarin.Android Intellisense在Visual Studio 2010中不起作用

更新时间:2023-02-06 11:39:57

Kannan Balasubramanian 有发布了一个对我有用的答案(二进制位)

Kannan Balasubramanian has posted an answer that worked for me (Binary Bits)

这里是Kannan的解决方案:

Here's Kannan's solution:

在Visual Studio 2012中使用Xamarin的Android版Mono的大多数人都遇到一个错误,即在源视图中Intellisense不适用于AXML.

Most of the people who work with Xamarin’s Mono for Android in Visual Studio 2012 face a bug where Intellisense doesn’t work for AXML in source view.

下面介绍了一种对我有用的修复程序.

One of the fix which worked for me is mentioned below.

  1. 启动Visual Studio 2012
  2. 打开其中包含.AXML文件的解决方案
  3. 现在XML主菜单应该显示在顶部
  4. 打开架构…"菜单
  5. 按文件名"列排序,然后查看是否有"android-layout-xml"和schemas.android.com.apk.res.android".如果找到,请跳到步骤13
  6. 如果未找到,则如果是32位系统,请转到程序文件",如果是64位系统,请转到程序文件(x86)".
  7. 然后转到"\ MSBuild \ Novell"或"\ MSBuild \ Xamarin \ Android" 您应该能够看到2个文件"android-layout-xml.xsd"和"schemas.android.com.apk.res.android.xsd"
  8. 将这两个文件复制到"\ Microsoft Visual Studio 11.0 \ Xml \ Schemas"中
  9. 再次打开第3和第4步中提到的"Schemas…"菜单
  10. 现在,单击添加..."按钮,然后添加这两个文件,这些文件应位于第7步和第9步中提到的位置. 8
  11. 现在重新启动Visual Studio,并且用于设计布局的XML编辑器应该可以在Intellisense上正常工作
  12. 从第5步开始....
  13. 如果上述步骤无效,请关闭Visual Studio 2012.
  14. 现在在Windows程序菜单下打开"VS2012开发人员命令提示符".
  15. 键入"Devenv/ResetSettings",不带引号.
  16. 启动Visual Studio 2012,并查看Intellisense是否起作用.
  17. 如果仍然无法正常工作,***进入Xamarin论坛并将其发布.
  1. Launch Visual Studio 2012
  2. Open a solution with .AXML file in it
  3. Now XML main menu should be visible on top
  4. Open "Schemas…" menu
  5. Sort by "File Name" column and see if "android-layout-xml" and schemas.android.com.apk.res.android" are there. If found, skip to step 13
  6. If not found, go to "Program Files" if 32-bit system or "Program Files (x86)" if 64-bit system.
  7. Then go to "\MSBuild\Novell" or "\MSBuild\Xamarin\Android" You should be able to see 2 files "android-layout-xml.xsd" and "schemas.android.com.apk.res.android.xsd"
  8. Copy these 2 files to "\Microsoft Visual Studio 11.0\Xml\Schemas"
  9. Again open the "Schemas…" menu as mentioned in steps 3&4
  10. Now click "Add…" button and add these 2 files which should be located as mentioned in step 7 & 8
  11. Now restart visual studio and the XML editor for design layout should work fine with Intellisense
  12. From step 5….
  13. If above steps don’t work, then close the Visual Studio 2012.
  14. Now open "Developer command prompt for VS2012″ under Windows programs menu.
  15. Type "Devenv /ResetSettings" without quotes.
  16. Launch Visual Studio 2012 and see if Intellisense works.
  17. If still not working, better go to Xamarin forums and post there.