Steps to Reproduce
-
Download, extract, and load the sample solution in Visual Studio 15.7.2.
AndroidEFCore21Soln.zip
-
Build and run the project.
Expected Behavior
The project should build and run.
Actual Behavior
The project won't build. The build fails with the following error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Perhaps it doesn't exist in the Mono for Android profile?
EF Core v2.1 or one of its dependencies in turn depends on package System.Memory v4.5.0, while the build appears to be trying to link the app with v4.0.1.0 of the System.Memory assembly.
The previous release of EF Core, v2.0.3, could be included in a Xamarin.Android project without causing this problem. If you change the sample solution to refer to package Microsoft.EntityFrameworkCore.Sqlite v2.0.3 instead of v2.1, the project builds and the app runs as expected.
Version Information
Microsoft Visual Studio Community 2017
Version 15.7.2
VisualStudio.15.Release/15.7.2+27703.2018
Microsoft .NET Framework
Version 4.7.02556
Installed Version: Community
Visual C++ 2017 00369-60000-00001-AA398
Microsoft Visual C++ 2017
Add New File 3.5
The fastest and easiest way to add new files to any project - including files that start with a dot
Application Insights Tools for Visual Studio Package 8.12.10405.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.0.40511.0
ASP.NET and Web Tools 2017
ASP.NET Core Razor Language Services 15.7.31476
Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2012 4.0.21208.0
For additional information, visit https://www.asp.net/
ASP.NET Web Frameworks and Tools 2017 5.2.60419.0
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 15.0.40424.0
Azure App Service Tools v3.0.0
C# Tools 2.8.2-beta6-62916-08. Commit Hash: 2ad4aabc7a9dada097e54e544ebba48ab1c05074
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
CodeMaid 10.4.53
CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
JavaScript UWP Project System 2.0
JavaScript UWP Project System
JetBrains ReSharper Ultimate 2017.2.2 Build 109.0.20171006.122324
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2018 JetBrains, Inc.
Merq 1.1.19-rc (a4ffc1b)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.
Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 4.10.5-pre (ab58725)
Support for debugging Mono processes with Visual Studio.
Node.js Tools 1.4.11027.3
Adds support for developing and debugging Node.js apps in Visual Studio
NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
Open Command Line 2.1.179
Opens a command line at the root of the project. Support for all consoles such as CMD, PowerShell, Bash etc. Provides syntax highlighting, Intellisense and execution of .cmd and .bat files.
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0
ResourcePackage Visual Studio Extension Detailed Info
Search in Velocity by Silverlake Software LLC 0.7.1
Provides a command to search in Velocity the offline documentation and docset viewer for Windows
SQL Server Data Tools 15.1.61804.210
Microsoft SQL Server Data Tools
SQLite & SQL Server Compact Toolbox 4.7
SQLite & SQL Server Compact Toolbox adds scripting, import, export, rename, query execution and much more to SQL Server Compact & SQLite Data Connections.
Syntax Visualizer 1.0
An extension for visualizing Roslyn SyntaxTrees.
TypeScript Tools 15.7.20419.2003
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 2.8.2-beta6-62916-08. Commit Hash: 2ad4aabc7a9dada097e54e544ebba48ab1c05074
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.1 for F# 4.1 15.7.0.0. Commit Hash: 56f97a8dd4353d897336941f3e644423b87c794f.
Microsoft Visual F# Tools 10.1 for F# 4.1
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Universal Windows Apps 15.0.27703.2018
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
VSColorOutput 2.5.1
Color output for build and debug windows - http://mike-ward.net/vscoloroutput
Windows Machine Learning Generator Extension 1.0
Windows Machine Learning Visual Studio Extension Detailed Info
Xamarin 4.10.0.448 (4373404db)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.12.270 (82d750d12)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 8.3.0.19 (HEAD/342b2ce96)
Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 11.10.1.178 (408d357)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Build Logs
1>------ Build started: Project: AndroidEFCore21, Configuration: Debug Any CPU ------
1> AndroidEFCore21 -> D:\Projects\AndroidEFCore21Soln\AndroidEFCore21\bin\Debug\AndroidEFCore21.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Perhaps it doesn't exist in the Mono for Android profile?
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : File name: 'System.Memory.dll'
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1590,2): error : at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Projects build report:
Status | Project [Config|platform]
-----------|---------------------------------------------------------------------------------------------------
Failed | AndroidEFCore21\AndroidEFCore21.csproj [Debug|Any CPU]
Time Elapsed 00:00:07.753
Log File
adb logcat output is not applicable as the app didn't even build.
Example Project
AndroidEFCore21Soln.zip
Steps to Reproduce
Download, extract, and load the sample solution in Visual Studio 15.7.2.
AndroidEFCore21Soln.zip
Build and run the project.
Expected Behavior
The project should build and run.
Actual Behavior
The project won't build. The build fails with the following error:
EF Core v2.1 or one of its dependencies in turn depends on package
System.Memoryv4.5.0, while the build appears to be trying to link the app with v4.0.1.0 of theSystem.Memoryassembly.The previous release of EF Core, v2.0.3, could be included in a Xamarin.Android project without causing this problem. If you change the sample solution to refer to package
Microsoft.EntityFrameworkCore.Sqlitev2.0.3 instead of v2.1, the project builds and the app runs as expected.Version Information
Build Logs
Log File
adb logcatoutput is not applicable as the app didn't even build.Example Project
AndroidEFCore21Soln.zip