简体   繁体   English

Xamarin Studio中的项目构建错误

[英]Project build error in xamarin studio

While building project an error is shown and build getting failed. 在构建项目时会显示错误,并且构建失败。

Error redirects to axml file below: 错误重定向到下面的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>

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. 检查Main.axml文件的“生成操作”。 It should be set to Android Resource but it sounds like it is set to Compile . 应该将其设置为Android Resource,但听起来像是将其设置为Compile

Right click the Main.axml file and use the Build Action menu to change this. 右键单击Main.axml文件,然后使用“构建操作”菜单进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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