简体   繁体   中英

Project build error in xamarin studio

While building project an error is shown and build getting failed.

Error redirects to axml file below:

<?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>

Error :

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)

Check the Build Action for the Main.axml file. It should be set to Android Resource but it sounds like it is set to Compile .

Right click the Main.axml file and use the Build Action menu to change this.

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