xamarin studio中的项目构建错误

本文关键字:构建 错误 项目 studio xamarin | 更新日期: 2023-09-27 17:50:57

在构建项目时显示错误,构建失败

错误重定向到下面的axml文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:minWidth="25px"
    android:minHeight="25px">
    <WebView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/webView" />
</LinearLayout>
错误:

C:'Users'Documents'Projects'''Resources'layout'Main.axml(1,1): Error CS0116:
     A namespace cannot directly contain members such as fields or methods (CS0116) 
    (ABC)

xamarin studio中的项目构建错误

检查Main的构建操作。axml文件。它应该设置为Android Resource,但听起来像是设置为Compile

右键单击Main。