Xamarin.Android Intellisense在Visual Studio 2010中不起作用 [英] Xamarin.Android Intellisense not working in Visual Studio 2010
问题描述
我正在Visual Studio 2010中测试Xamarin.Android,并且注意到在使用Android布局(.axml)文件时,我没有Android Intellisense.但是,当我使用.cs文件时,确实会得到Android Intellisense.
I'm testing out Xamarin.Android in Visual Studio 2010 and have noticed that I have no Android Intellisense when I'm working in an Android Layout (.axml) file. However, I do get Android Intellisense when I'm working in a .cs file.
示例:
这是我的Main.axml文件的屏幕截图,该文件位于我的Layout目录中.请注意,Intellisense如何在Android名称空间中不包含任何内容.
Here is a screenshot of my Main.axml file that lives in my Layout directory. Notice how the intellisense doesn't contain anything within the Android namespace.
要获取智能感知才能在.axml文件中显示Android名称空间,我该怎么做?
What do I need to do to get intellisense to display the Android namespace in a .axml file?
推荐答案
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.
- 启动Visual Studio 2012
- 打开其中包含.AXML文件的解决方案
- 现在XML主菜单应该显示在顶部
- 打开架构…"菜单
- 按文件名"列排序,然后查看是否有"android-layout-xml"和schemas.android.com.apk.res.android".如果找到,请跳到步骤13
- 如果未找到,则如果是32位系统,请转到程序文件",如果是64位系统,请转到程序文件(x86)".
- 然后转到"\ MSBuild \ Novell"或"\ MSBuild \ Xamarin \ Android" 您应该能够看到2个文件"android-layout-xml.xsd"和"schemas.android.com.apk.res.android.xsd"
- 将这两个文件复制到"\ Microsoft Visual Studio 11.0 \ Xml \ Schemas"中
- 再次打开第3和第4步中提到的"Schemas…"菜单
- 现在,单击添加..."按钮,然后添加这两个文件,这些文件应位于第7步和第9步中提到的位置. 8
- 现在重新启动Visual Studio,并且用于设计布局的XML编辑器应该可以在Intellisense上正常工作
- 从第5步开始....
- 如果上述步骤无效,请关闭Visual Studio 2012.
- 现在在Windows程序菜单下打开"VS2012开发人员命令提示符".
- 键入"Devenv/ResetSettings",不带引号.
- 启动Visual Studio 2012,并查看Intellisense是否起作用.
- 如果仍然无法正常工作,最好进入Xamarin论坛并将其发布.
- Launch Visual Studio 2012
- Open a solution with .AXML file in it
- Now XML main menu should be visible on top
- Open "Schemas…" menu
- 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
- If not found, go to "Program Files" if 32-bit system or "Program Files (x86)" if 64-bit system.
- 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"
- Copy these 2 files to "\Microsoft Visual Studio 11.0\Xml\Schemas"
- Again open the "Schemas…" menu as mentioned in steps 3&4
- Now click "Add…" button and add these 2 files which should be located as mentioned in step 7 & 8
- Now restart visual studio and the XML editor for design layout should work fine with Intellisense
- From step 5….
- If above steps don’t work, then close the Visual Studio 2012.
- Now open "Developer command prompt for VS2012″ under Windows programs menu.
- Type "Devenv /ResetSettings" without quotes.
- Launch Visual Studio 2012 and see if Intellisense works.
- If still not working, better go to Xamarin forums and post there.
这篇关于Xamarin.Android Intellisense在Visual Studio 2010中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!