Download, extract, and load the sample solution in Visual Studio 15.7.2.
iOSEFCore21Soln.zip
Build and run the project, targeting either iPhone or iPhone Simulator.
The project should build and run, writing some lines to debug output indicating that Entity Framework Core has created a database from the simple model included in the project.
The project won't build. The build fails with the following error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): error : Can't resolve the reference 'System.ReadOnlySpan
1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan1Microsoft.Extensions.Primitives.StringSegment::AsSpan()' in 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
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 linking the app with v4.0.1.0 of the System.Memory assembly included in Xamarin.iOS.
The previous release of EF Core, v2.0.3, could be included in a Xamarin.iOS 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, ithe project builds and the app runs as expected.
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.
1>------ Build started: Project: iOSEFCore21, Configuration: Debug iPhone ------
1> Connecting to Mac server cwrea-mini...
1> Connecting to Mac server cwrea-mini...
1> No way to resolve conflict between "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "System.Reflection, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Reflection, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Collections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "System.Diagnostics.Debug, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Diagnostics.Debug, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> No way to resolve conflict between "System.Threading, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Choosing "System.Threading, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" arbitrarily.
1> Consider app.config remapping of assembly "System.Runtime, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll] to Version "4.0.20.0" [] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Collections, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Collections\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.dll] to Version "4.0.10.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.Collections.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Threading, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Threading\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.dll] to Version "4.0.10.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.Threading.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Diagnostics.Debug, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Debug\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Debug.dll] to Version "4.0.10.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades\System.Diagnostics.Debug.dll] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Reflection, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Reflection\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Reflection.dll] to Version "4.0.10.0" [] to solve conflict and get rid of warning.
1> Consider app.config remapping of assembly "System.Runtime.Extensions, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.0.0" [C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Extensions.dll] to Version "4.0.10.0" [] to solve conflict and get rid of warning.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
1> iOSEFCore21 -> D:\Projects\iOSEFCore21Soln\iOSEFCore21\bin\iPhone\Debug\iOSEFCore21.exe
1> Detected signing identity:
1> Code Signing Key: "iPhone Developer: [...] (...)"
1> Provisioning Profile: "cwrea iOS Dev Prov. Profile" (...)
1> Bundle Id: com.companyname.iOSEFCore21
1> App Id: J7ADM89KY9.com.companyname.iOSEFCore21
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.IO.Compression.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.IO.Compression.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/System.IO.Compression.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.Net.Http.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.Net.Http.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/System.Net.Http.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.Runtime.InteropServices.RuntimeInformation.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.Runtime.InteropServices.RuntimeInformation.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/Facades/System.Runtime.InteropServices.RuntimeInformation.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.Security.Cryptography.Algorithms.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.Security.Cryptography.Algorithms.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/Facades/System.Security.Cryptography.Algorithms.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.Security.Cryptography.Encoding.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.Security.Cryptography.Encoding.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/Facades/System.Security.Cryptography.Encoding.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): warning : The assembly 'System.Security.Cryptography.X509Certificates.dll' was loaded from a different path than the provided path (provided path: /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/9d38db02eb7af8d56c5be8ed8fd7f99b/bin/iPhone/Debug/System.Security.Cryptography.X509Certificates.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/lib/mono/Xamarin.iOS/Facades/System.Security.Cryptography.X509Certificates.dll).
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): error : Can't resolve the reference 'System.ReadOnlySpan`1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan`1<System.Char> Microsoft.Extensions.Primitives.StringSegment::AsSpan()' in 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Projects build report:
Status | Project [Config|platform]
-----------|---------------------------------------------------------------------------------------------------
Failed | iOSEFCore21\iOSEFCore21.csproj [Debug|iPhone]
Time Elapsed 00:00:23.221
I am able to still reproduce this with the sample on 15.7.3.
I see it may be resolved for XA (see https://github.com/xamarin/xamarin-android/issues/1769) already.
@spouliot I don't fully understand the problem here, but is there something done for XA with the facades that need to be done for XI too?
@therealjohn I confirmed the similar issue is resolved for Xamarin.Android with 15.7.3. I can also confirm I'm still seeing it as an issue on Xamarin.iOS with 15.7.3.
I am hitting this in iOS when referencing Microsoft.Extensions.DependencyInjection. Are there any workarounds until this gets fixed?
I was able to implement a workaround. I downgraden all package references for “Microsoft.extensions.*” to Version 2.0.0. In csproj file and PackageS.config
@leonvandebroek this workaounrd does not appear to address my problem when attempting to run an iOS app on a device. I can compile, but get a "could not AOT the assembly..." error when I attempt to deploy.
Does anyone know if this is on the radar to be addressed in 15.7.4? I am hoping that EF Core 2.1 fixes a problem on iOS related to tables with more than 14 columns and/or nullable data types., but at this point I can't even get the app running on iOS to test.
Confirming @cfdelaune's comment. Downgrading package references for Microsoft.Extensions.* is not an effective workaround.
I tried on the sample project for this issue. In particular, I downgraded Microsoft.Extensions.Primitives to 2.0.0 in iOSEFCore21.csproj, which avoids requiring System.Memory 4.5.0:
<PackageReference Include="Microsoft.Extensions.Primitives">
<Version>2.0.0</Version>
</PackageReference>
... however, when targeting a physical device, C# compilation succeeds, but the build fails during AOT with an assertion failure, "aot-compiler.c:3118, condition `t->num_mods == 0' not met":
1> AOT Compilation exited with code 134, command:
1> MONO_PATH=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 --aot=mtriple=arm64-ios,data-outfile=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/arm64/Microsoft.EntityFrameworkCore.aotdata.arm64,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/arm64/Microsoft.EntityFrameworkCore.dll.s "/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.EntityFrameworkCore.dll"
1> Mono Ahead of Time compiler - compiling assembly /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.EntityFrameworkCore.dll
1> AOTID 009AF93F-42A4-41F7-02F9-8FDC36465855
1> * Assertion at /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/external/mono/mono/mini/aot-compiler.c:3118, condition `t->num_mods == 0' not met
1> AOT Compilation exited with code 134, command:
1> MONO_PATH=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/11.12.0.4/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 --aot=mtriple=arm64-ios,data-outfile=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/arm64/Microsoft.EntityFrameworkCore.Relational.aotdata.arm64,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/arm64/Microsoft.EntityFrameworkCore.Relational.dll.s "/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.EntityFrameworkCore.Relational.dll"
1> Mono Ahead of Time compiler - compiling assembly /Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.EntityFrameworkCore.Relational.dll
1> AOTID 9F48A88C-B8A2-1C27-0727-9CE918D2E9D8
1> * Assertion at /Users/builder/data/lanes/5944/64fece5f/source/xamarin-macios/external/mono/mono/mini/aot-compiler.c:3118, condition `t->num_mods == 0' not met
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(791,3): error : Could not AOT the assembly '/Users/cwrea/Library/Caches/Xamarin/mtbs/builds/iOSEFCore21/e8ab617d17c8d48180dd2ebc14bac7aa/obj/iPhone/Debug/mtouch-cache/Build/Microsoft.EntityFrameworkCore.dll'
FWIW, this issue I opened is not just impacting users attempting to upgrade to Entity Framework Core 2.1, but is also a problem for users of SignalR on Xamarin: aspnet/SignalR #1886 - Xamarin support tracking issue. Quoting @davidfowl:
There's a bunch of work that is planned but that is also required to make SignalR work. There is an issue in System.Memory preventing it from being used in Xamarin applications. This issue is tracking the work that is being done in corefx to remedy the situation.
I tried another potential workaround, but still no luck.
The following claim was made in a comment on the .NET Standard issue at https://github.com/dotnet/standard/issues/682#issuecomment-373960169:
The System.Memory package (which contains Span/Memory/etc) is available OOB (for full framework and older version of .net core (like 2.0), and it complies with netstandard1.1 so can be used on any of the platforms that meet netstandard1.1+ spec.
(Here's my own follow-up comment, for what it's worth.)
Anyway, I thought: Perhaps if I remove the Xamarin.iOS.framework copy of the broken System.Memory.dll facade, and then manually reference either netstandard1.1/netstandard2.0 versions of System.Memory and System.Buffers (required for the netstandard targets) in the iOS project, then maybe it will work.
But no success. With this attempted workaround, I still end up with the same "AOT Compilation exited with code 134" messages as when trying to downgrade Microsoft.Extensions.Primitives to 2.0.0.
I just updated to latest nuget for XF 3.x and still get the error when (trying to) deploying to iOS real device. DOES run on iOS simulator.
I also need to stay on .net Core 2.1 for my EF and other bits since they helped resolve other problems. Anyone know the best way to ensure this is getting the attention it needs by the right folks? Seems like the problem is in System.Memory for Microsoft.Extensions.Primitives. At least it is for me.
System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan`1
I reported via Visual Studio problem reporting under "System.MemoryExtensions related Build failure for iOS" - maybe if people "thumbs up" we can get more MS attention on problem?
The issue is know and is fixed in the latest patch which will be released very soon.
Thanks @DavidFowl. Fyi, I just again updating to very latest Microsoft.EntityFrameworkCore 2.11 nugets - but did not help (and also regressed Android build to a new compile-time error re System.Buffers). Which package should include the patch that should fix the problem? (And thanks again)
@dgerding The patch may be in reference to an upcoming maintenance release of Visual Studio + Xamarin, and not a NuGet package.
@davidfowl. Do you mean version 15.7.4 of Visual Studio?
This is solve with VS2017 version 15.7.4 by updating EFCore v2.1.1 and all Microsoft.Extensions.* v2.1.1
UPDATE : I can only compile without error in Simulator configuration
I can confirm that this is NOT working on a physical iOS device using EFCore 2.1.1 and VS 15.7.4.
Potentially related: https://github.com/aspnet/Announcements/issues/305:
ASP.NET Core 2.1.1 contains fixes to resolve blocking issues when using the SignalR Client from Xamarin. However, these fixes also require an updated build of Xamarin.iOS and Xamarin.Android, as well as some additional dependencies.
In addition to new packages for SignalR, it also mentions Visual Studio 15.8 Preview 3 with Xamarin.iOS 11.14.0.4 as needed to fully resolve the blocking issues. FWIW, an issue previously reported with SignalR on Xamarin.iOS also related to System.Memory.
Crossing my fingers this issue also gets resolved by VS 15.8 Preview 3.
@smitpatel I think you tested EF Core 2.1 with the preview build. Did it all work?
Anyone have an eta on the 15.8.3 Preview that might fix things? I'm downloading the preview to try just in case. @cwrea?
mines resisting rolling back to 2.03.... and I'm having the same problem as you guys
same issue here. With VS 15.7.4 as well as VS for Mac 7.5.3.
EDIT: On VS 15.7.4 I'm able to build the IOS project when I add the Microsoft.Extensions.Primitives and deactivate Linking at all. VS for Mac gives me then the error "could not AOT assembly MT3001"
Currently just downgraded to 2.0.3 as a workaround.
@dgerding I haven't found anything concrete about an official release date for Visual Studio 15.8.0. ¹ However, if I had to bet based on the release dates of other 15.x updates (summary below), I'd say odds are good we can expect 15.8.0 by August, and perhaps sooner — unless 15.8 takes longer than any other 15.x update has taken so far.
15.0 2017-03
15.1 2017-04
15.2 2017-05
15.3 2017-08
15.4 2017-10
15.5 2017-12
15.6 2018-03
15.7 2018-05
The 15.8 Preview 3 release, though, I would expect sooner. 15.8 Preview 1 was released on 07-May-2018 and 15.8 Preview 2 was released 31-May-2018. So, real soon now? :)
¹ I wouldn't abbreviate "15.8 Preview 3" as "15.8.3". Once out of preview, the next VS minor update will be 15.8.0, whereas "15.8.3" would be a 3rd servicing update some weeks after 15.8.0. Useful: https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2017-release-rhythm
@trevor-smith-nanotechsoftware-co-uk If you can't get Visual Studio to cooperate in rolling back EF Core 2.1 to 2.0.3, I suggest either starting fresh after removing all packages, and then re-add the specific versions needed, or else manually edit your *.csproj files and paste in the package references from an earlier version of your project (from source control) where the references were for EF Core 2.0.3.
Hi Chris
I beat in to shape shortly after posting … and its okay and solved the issue with EFCore …. I rolled back both Core and SQL (mentioned in the comments) and it solved the problem…..
Thanks...
Best Regards
Trevor Smith
NanoTech Software Ltd
01603 851 707 (Direct)
07535 447394 (mobile)
www.nanotechsoftware.co.uk http://www.nanotechsoftware.co.uk/
This e-mail, including any attachments, is intended for the above named recipient(s) only and may be confidential. If it has come to you in error you must take no action based on it, nor must you copy it or use it for any other purposes, or disclose the content of the e-mail to any other person, or store or copy the information in any medium. If you have received this email in error, please notify [email protected] info@nanotechsoftware.co.uk immediately quoting the name of the sender and the addressee then delete it from your system.
Any views or opinions expressed within this email are those of the author and do not necessarily represent those of nanoTech Software Ltd.
On 22 Jun 2018, at 14:59, Chris W. Rea notifications@github.com wrote:
@trevor-smith-nanotechsoftware-co-uk https://github.com/trevor-smith-nanotechsoftware-co-uk If you can't get Visual Studio to cooperate in rolling back EF Core 2.1 to 2.0.3, I suggest either starting fresh after removing all packages, and then re-add the specific versions needed, or else manually edit your *.csproj files and paste in the package references from an earlier version of your project (from source control) where the references were for EF Core 2.0.3.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/xamarin/xamarin-macios/issues/4168#issuecomment-399451969, or mute the thread https://github.com/notifications/unsubscribe-auth/AmGJucKTYA4glAx5FMrHXqDwdW6pZvj-ks5t_PhAgaJpZM4UVepc.
ok beat back EFCore & SQLCore for good measure ... I was on a killing spree .... to 2.03 and it fixed the problem ...... thanks guys
I had the AOT assembly MT3001" too ... I did realise the the phone I was using was not the one provissioned months ago..... I went into XCode .. and due to upgrades it had forgotten me ..... I created a new proj in xcode gave it all the prov info.... let it get aquainted with my phone ... and then deploy the test app .... after that things started to settle down....
when I say settle down ... I mean VS behaved ... I was able to have it do network deployment even .. woohoo!
@trevor-smith-nanotechsoftware-co-uk but that was with v2.0.3 right?
yeah .. let me clarify ... ... I am working on 27 apps that share a common dll .... in a single solution ... that was what was causing things to hang on to the latest EFCore ..... so I isolated one app and the assembly (dll) ... Got the EF & SQL core back to 2.03 ... I went into Xcode set up a new swift test app (just bare) and all the provisioning .... and pushed it to my phone ... I went back to VS Cleaned solution ...(didn't deleted bin or any folder) .... went to the IOS app properties and set automatic etc there (I had done it before but I set manual and then back to auto..... VS had spotted my phone (USB connect) and ran it with a positive outcome ... I keep an eye on the Output window ... it takes a while ....like 5 minutes or more ....with no feedback which is unnerving... make sure the connection to the Mac is up first/before... mine drops all the time ....even though I am running VS in a virtual PC on a Mac Pro.... I just disconnect and reconnect if I am in doubt...
oh and I have the latest VS release
I tested EF Core 2.1.1 packages on VS for Mac 7.6 Preview 3 build, with Mono version - 5.12.0.273 & Xamarin.iOS version - 11.14.0.4
The sample app shared by @cwrea built successfully without giving any error about System.Memory. It threw exception at runtime though from EF Core stack. Is that expected behavior? It would be useful if someone can share a sample app working in 2.0 releases which fails in doing upgrade to 2.1, which I can utilize to figure out if EF Core needs further fixes to make this work. (just info: I am using VS for Mac for apps targeting Xamarin.iOS)
@smitpatel When you wrote "sample app shared by @cwrea", did you mean the issue repro project linked at top in this issue about builds failing on iOS due to System.Memory, or did you mean the XamarinTodo sample that I had ported from SQLite-PCL.Net to EF Core 2.0.3 and that I mentioned at https://github.com/aspnet/EntityFrameworkCore/issues/8792?
If you're referring only to this issue's repro, then I suggest trying the XamarinTodo sample. That app did compile and deploy and function on both Android and iOS devices with EF Core 2.0.3. I failed to get it working with EF Core 2.1, due to this issue for iOS and similar issues on Android.
@cwrea - I meant the repro code attached here. I will try with https://github.com/cwrea/XamarinTodo/tree/NETStd20_EFCore203
Thanks.
I've the same issue when i use EF 2.0.3 and SignalR 1.0.1 (System.ReadOnlySpan1
Hi all (especially @cwrea :) ),
I just installed the new VS 15.8 Preview 3 build and I can report the I no longer get the "ReadOnlySpan" build error _and_ I can run on the iOS simulator, which it wouldn't do before.
Yes, 15.8 P3 _does_ update to a new Xamarin.iOS build, which VS for Windows did for me. Nice.
Unfortunately, I still can't get a build to deploy to real device. Think it's unrelated but thought people would want to know that 15.8 p3 does seem to fix the problem. I'll know for sure when I can deploy to a real device !
Dave G
Hooray!
@cwrea Also, since my project _also_ targets Android with EF2.1.1 I wanted to report that I don't get any System.Memory related errors on 15.8 Pre3 using latest release nugets. So it might have fixed the related issue, too.
:( "Premature Hooray".
I couldn't get project to build to real device on my own system but wasn't getting memory related error. Just "app halted"... however, on an AppCenter hosted iOS build I see something familiar:
(_CompileToNative target) ->
MTOUCH : error MT2101: Can't resolve the reference 'System.ReadOnlySpan1<System.Char> System.MemoryExtensions::AsSpan(System.String,System.Int32,System.Int32)', referenced from the method 'System.ReadOnlySpan1
Still nothing ?
I no longer get the build error after installing the latest .NET Core version (2.1.2). I believe this PR fixed the issue.
Could someone else please confirm?
@therealjohn - That is correct. We have made fix to stop having build error in this case. If you are encountering any other error once you are past that, please file an issue in appropriate place so we can make things better.
Hi
I am glad to hear that there is a resolution however as a consequence of some update by either xamarin M’soft or apple at the weekend my entire environment has turned to molasses and also rejects my mobile devices …. So I can’t test anything until I rebuild my dev environment
Best Regards
Trevor Smith
NanoTech Software Ltd
01603 851 707 (Direct)
07535 447394 (mobile)
www.nanotechsoftware.co.uk http://www.nanotechsoftware.co.uk/
This e-mail, including any attachments, is intended for the above named recipient(s) only and may be confidential. If it has come to you in error you must take no action based on it, nor must you copy it or use it for any other purposes, or disclose the content of the e-mail to any other person, or store or copy the information in any medium. If you have received this email in error, please notify [email protected] info@nanotechsoftware.co.uk immediately quoting the name of the sender and the addressee then delete it from your system.
Any views or opinions expressed within this email are those of the author and do not necessarily represent those of nanoTech Software Ltd.
On 24 Jul 2018, at 17:01, Smit Patel <[email protected] notifications@github.com> wrote:
@therealjohn https://github.com/therealjohn - That is correct. We have made fix to stop having build error in this case. If you are encountering any other error once you are past that, please file an issue in appropriate place so we can make things better.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/xamarin/xamarin-macios/issues/4168#issuecomment-407460092, or mute the thread https://github.com/notifications/unsubscribe-auth/AmGJuX40BhgnYSgl_9pXWPLXeOjE0uShks5uJ0TygaJpZM4UVepc.
I'm running into this problem trying to build for a real ios device. Has there been any progress on this problem?
Visual Studio Community 2017 for Mac
Version 7.5.4 (build 3)
Error MT3001: Could not AOT the assembly '.../Microsoft.EntityFrameworkCore.dll' (MT3001)
I just gave this a shot using the latest stable bits (VS 2017 [15.7.6], NET STANDARD 2.0.3, EF 2.1.1, etc.) and run into the same issue as before.
Based on this thread, my hope is that these issues are resolved in VS 2017 [15.8] which I imagine will drop soon. I expect to be able to test as soon as it is released and will report back.
If anyone monitoring this thread has more information please let me know! Thanks.
The build works fine for me in VS 15.8. I'm now able (after months...) to build on iOS successfully ;-).
But only on the simulator! If I build on a real device, I will recive the following error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): error MT5209: Native linking error: framework not found Carbon
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'gdiplus' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'gdi32' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'user32' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'libX11' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'libcups' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'gdiplus' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): warning MT5215: References to 'winspool' might require additional -framework=XXX or -lXXX instructions to the native linker
6>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(793,3): error MT5202: Native linking failed. Please review the build log.
@Diraekt, using VS 15.8.1, I am (finally) able to compile and run on a physical iOS device.
The whole point of this for me has been to address the problem described here (allow tables with more than 14 columns and/or nullable types on iOS), which is unfortunately still not working.
@cfdelaune thanks for your response. You think I will recive a Linker error at compile time because of your described problem? I think your described problem will cause a runtime exception. You have an idea why carbon framework is not founded when I build to a real device?
(Hard to understand, that nobody on iOS can use EF since months....)
I've tried the original test project [1], and while as-is it failed to build, it succeeded (both for device and simulator) after I upgraded the Microsoft.EntityFrameworkCore.Sqlite package from v2.1.0 to v2.1.2, so I'm closing this.
I did not see any of the MT5215 warnings reported in https://github.com/xamarin/xamarin-macios/issues/4168#issuecomment-416170628; so if you see these (or any other problem for that matter), please file a new issue with a test project.
[1] With the current stable versions of Xamarin.iOS (11.14.0.14) & Mono (5.12.0.301)
Visual Studio Enterprise 2017 for Mac (Preview)
Version 7.7 Preview (7.7 build 1143)
Installation UUID: 5090bacd-da8d-4e67-8581-ba6c51620337
Runtime:
Mono 5.12.0.301 (2018-02/4fe3280bba1) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)
Package version: 512000301
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.7
SDK: /usr/local/share/dotnet/sdk/2.1.105/Sdks
SDK Version: 2.1.105
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
'/Applications/Xamarin Profiler.app' not found
Apple Developer Tools
Xcode 9.4 (14160)
Build 9F1027a
Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.
Xamarin.iOS
Version: 11.14.0.14 (Visual Studio Enterprise)
Hash: d807bb8f
Branch: HEAD
Build date: 2018-07-25 09:04:12-0400
Xamarin.Android
Not Installed
Android Device Manager
Version: 7.7.1.0
Hash: c401ae7e
Xamarin Inspector
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
Build Information
Release ID: 707001143
Git revision: 2ae7642c9d35b61b7973c964ed7a23f77b52a3ea
Build date: 2018-08-29 22:21:08+00
Build branch: release-7.7
Xamarin extensions: 118d45e2a9e7473c3df01e889009b3056e730adc
Operating System
Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
Thu Jun 21 22:53:14 PDT 2018
root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
When will this issue be fixed? I need it so badly to be fixed!
@DoubleDBE to the best of my knowledge, this issue was already fixed. If you are seeing similar symptoms, consider creating a new issue and make sure you include the full details about how to repro, versions involved, and the exact error.
@divega @DoubleDBE I have an IOS Application using version 2.2.4 which is working fine.
Yes … This issue was resolved a while back
Best Regards
Trevor Smith
NanoTech Software Ltd
01603 851 707 (Direct)
07535 447394 (mobile)
www.nanotechsoftware.co.uk http://www.nanotechsoftware.co.uk/
This e-mail, including any attachments, is intended for the above named recipient(s) only and may be confidential. If it has come to you in error you must take no action based on it, nor must you copy it or use it for any other purposes, or disclose the content of the e-mail to any other person, or store or copy the information in any medium. If you have received this email in error, please notify [email protected] info@nanotechsoftware.co.uk immediately quoting the name of the sender and the addressee then delete it from your system.
Any views or opinions expressed within this email are those of the author and do not necessarily represent those of nanoTech Software Ltd.
On 23 Jun 2019, at 14:09, Nino Padrutt notifications@github.com wrote:
@divega https://github.com/divega @DoubleDBE https://github.com/DoubleDBE I have an IOS Application using version 2.2.4 which is working fine.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/xamarin/xamarin-macios/issues/4168?email_source=notifications&email_token=AJQYTOOTMQYVSDZNSOSXSALP35YZ3A5CNFSM4FCV5JOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYK6DIQ#issuecomment-504750498, or mute the thread https://github.com/notifications/unsubscribe-auth/AJQYTONVEXQO7OBYQ6LE4QTP35YZ3ANCNFSM4FCV5JOA.
It's working fine on VS 2017. However on VS 2019 i'm getting this error #https://github.com/mysql-net/MySqlConnector/issues/644
The moment Xamarin.iOS SDK v12.10.x is installed on my mac, i'm getting this error.
We are using vs 2019 . Latest versions of everything but EF.Core 2.2.4 … all works fine
Best Regards
Trevor Smith
NanoTech Software Ltd
01603 851 707 (Direct)
07535 447394 (mobile)
www.nanotechsoftware.co.uk http://www.nanotechsoftware.co.uk/
This e-mail, including any attachments, is intended for the above named recipient(s) only and may be confidential. If it has come to you in error you must take no action based on it, nor must you copy it or use it for any other purposes, or disclose the content of the e-mail to any other person, or store or copy the information in any medium. If you have received this email in error, please notify [email protected] info@nanotechsoftware.co.uk immediately quoting the name of the sender and the addressee then delete it from your system.
Any views or opinions expressed within this email are those of the author and do not necessarily represent those of nanoTech Software Ltd.
On 23 Jun 2019, at 14:14, DoubleDBE notifications@github.com wrote:
It's working fine on VS 2017. However on VS 2019 i'm getting this error #mysql-net/MySqlConnector#644 https://github.com/mysql-net/MySqlConnector/issues/644
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/xamarin/xamarin-macios/issues/4168?email_source=notifications&email_token=AJQYTOLANWHZMV3PH6YTP6LP35ZJZA5CNFSM4FCV5JOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYK6HCI#issuecomment-504750985, or mute the thread https://github.com/notifications/unsubscribe-auth/AJQYTOONFIFBQKK5A4XN7STP35ZJZANCNFSM4FCV5JOA.
I've edited my comment.
Most helpful comment
The issue is know and is fixed in the latest patch which will be released very soon.