Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute

Tags:

xamarin

My code works fine, but when I added fragments with a new namespace to the project, I began getting the error

You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute

I've searched online and found several mentions of unlinking assemblies, but I've also read that this will cause additional errors.

Does anyone know how to solve this bug?

like image 471
Rupert Avatar asked Jun 27 '15 05:06

Rupert


4 Answers

I found the answer. Right click references and search Export. Just add the Mono.Android.Export to your project.

like image 146
Rupert Avatar answered Nov 10 '22 10:11

Rupert


enter image description here I added reference like @Jeremy Said, it's working

like image 40
Arun Prasad E S Avatar answered Nov 10 '22 10:11

Arun Prasad E S


If you're using JetBrains Rider, you can solve the issue by adding the Mono.Android.Export reference to your Android .csproj file:

<!-- ExampleApp.Android.csproj -->
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    ...
    <ItemGroup>
        <Reference Include="Mono.Android" />
        <Reference Include="Mono.Android.Export" />
    </ItemGroup>
    ...
</Project>
like image 13
Ryan Payne Avatar answered Nov 10 '22 08:11

Ryan Payne


You don't need download dll from the web if you cant find it in the reference manager

just do following steps:

  1. Set the target framework to Android 4.4 kit kat
  2. Add reference mono.android.expert.dll
  3. set targetFramework as last good target framework

Clean solution and rebuild

I hope it helps you.

like image 3
Ali Besharati Avatar answered Nov 10 '22 09:11

Ali Besharati