Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would the following errors occur in Xamarin Studio on OS X but not in Visual Studio?

I'm trying to understand why I'm getting the following errors when running tests in Xamarin Studio 5.9.1 (build 3) on OS X.


System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

System.IO.FileNotFoundException


System.TypeLoadException : A type load exception has occurred.

System.TypeLoadException


All projects build successfully and the same tests run just fine in Visual Studio on Windows using the same solution.

I am seeing a warning when building the test project on OS X, despite having already installed and added the reference.

All projects referencing MyProject.fsproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.

like image 255
Paul Young Avatar asked May 12 '15 04:05

Paul Young


People also ask

What are the differences between the Xamarin Studio and Visual Studio?

It is more a code editor with a little extra (like type checking and building). Xamarin Studio is a quite capable IDE, but is less configurable than Visual Studio. Also, it is focused more on Xamarin development, and less on general C# development.

Does Xamarin work with Visual Studio code?

The primary software/program used for Xamarin cross platform development is Microsoft's Visual Studio. Visual Studio is classified as an Integrated Development Environment (IDE) that is used to build Xamarin apps. So, it has all the functionality you would need to build, debug and publish apps.

What .NET framework does Xamarin use?

The Xamarin Platform is based on Mono. Mono is the original open source and cross-platform implementation of . NET, from the community Mono Project.

Is Xamarin Visual Studio?

Xamarin is a . NET developer platform made up of tools, programming languages, and libraries for building many different types of applications. Xamarin supplies add-ins to Microsoft Visual Studio that allows developers to build Android, iOS, and Windows apps within the IDE using code completion and IntelliSense.


1 Answers

I still don't know why Xamarin behaves differently than Visual Studio, but the root cause was that the test project was targeting .Net 4.5 whereas the main project was targeting .Net 4.0

Thanks to @7sharp9 for the help.

like image 185
Paul Young Avatar answered Oct 12 '22 18:10

Paul Young