Alejandro Castán
Alejandro Castán

Reputation: 299

Metadata file .dll' could not be found

I am trying with Xamarin and I try to deploy the iOs project to see it into iOS Emulator and I could not do it because I have the following error

metadata file .dll' could not be found......

I have try to fix it clean the solution and rebuild the project and solution and others found in Stackoverflow website but I could not fix it, for it, Could anybody help me with that? Thanks in advance Alejandro Castan Ps. Sorry for my little English

Upvotes: 13

Views: 12621

Answers (7)

Anand
Anand

Reputation: 872

If anybody facing this issue in VS 2022, if you enable MSBuild on Mono it might help in resolving. Please see below the screenshot were it asks for the same.

MSBuild on Mono

Upvotes: 2

benjamingranados
benjamingranados

Reputation: 528

In my case this was due to having conditional compilation symbols in my code (__IOS__;__ANDROID__), so, you have to define them in the Debug or Release Build Options located at the Build/General options tab of the Project.

Upvotes: 0

Zweisteine
Zweisteine

Reputation: 31

You may have tried to build the whole solution.

For me it was because the Xamarin Form project has an error therefore it cannot build the xxx.dll. So when I build the whole solution, the Android project will try to use the xxx.dll, which is the metadata file, but as the Xamarin.Form project is not built successfully, this dll is not there.

So you should build the Xamarin.Form project first and make sure this one builds. It will give you more specific error locations when you build this one.

Upvotes: 0

TMSAL
TMSAL

Reputation: 133

You might have two XAML file with same x:Class name, probably when you copy a XAML file forgot to rename the x:Class name

Upvotes: 1

wangkaibule
wangkaibule

Reputation: 848

For me dealing with a legacy app with multiple dll parts, I need to:

  • Drop the not found assembly references and add them back as project references.
  • And also make sure to compile the iOS version with "platform x64" or "platform x86" configuration, instead of "AnyCPU".

Then the compilation works well via a remote Mac connection.

As a clarification, the question doesn't mention how the iOS version is compiled when the problem happens. In my situation, the legacy code compiles well if I compile it on a local Mac device, the same problem only happens when I try to figure out the remote Mac compilation on my Windows Visual Studio.

Upvotes: 0

A. Gh
A. Gh

Reputation: 711

These kind of errors occur many times in Visual Studio 201X projects. What I did to fix it, was:

  1. Right click on the Solution --> at the left panel click on Configuration Properties --> Configuration and try to uncheck the projects where the .dll errors are referring to, apply, and then recheck & apply again.
  2. If this doesn't fix the problem for you, try to solve the other code errors first, and then rebuild the solution. The Metadata file '.dll' could not be found errors didn't occur anymore after solving the other code errors.

Upvotes: 12

Iain STIRZAKER
Iain STIRZAKER

Reputation: 331

I take no credit for this, but it worked for me:

http://www.cazzulino.com/project-dependency-does-not-build-with-xamarin.html

Upvotes: 1

Related Questions