EF Core 7和iOS for .Net MAUI

5f0d552i  于 2023-07-01  发布在  iOS
关注(0)|答案(1)|浏览(134)

使用EF Core启动应用程序时,获取下一个输出日志:

Loaded assembly: data-0x1611d8000 [External]
Loaded assembly: data-0x16178c000 [External]
Thread started: <Thread Pool> #7
2023-06-29 00:27:45.546 Xamarin.PreBuilt.iOS[49768:3128527] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/7B9D6681-A646-430C-A453-1D831127C8A2/Documents/FP.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

2023-06-29 00:27:45.553 Xamarin.PreBuilt.iOS[49768:3128527] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/7B9D6681-A646-430C-A453-1D831127C8A2/Documents/FP.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:423 [0x00000].
Loaded assembly: /private/var/containers/Bundle/Application/5440EC53-4C5F-4E22-B690-E5E921E53C5B/FP.app/System.Text.Encodings.Web.dll [External]
2023-06-29 00:27:45.765 Xamarin.PreBuilt.iOS[49768:3128527] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/7B9D6681-A646-430C-A453-1D831127C8A2/Documents/FP.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

2023-06-29 00:27:45.774 Xamarin.PreBuilt.iOS[49768:3128527] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/7B9D6681-A646-430C-A453-1D831127C8A2/Documents/FP.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000].
Resolved pending breakpoint at 'MainContext.cs:114,1' to void FP.Repository.SQLite.Context.MainContext.<InitStorageIfNeededAsync>d__30.MoveNext () [0x0002a].
The app has been terminated.

iOS应用程序刚刚启动,命中断点,停留几秒钟并终止。已禁用热重新加载,但无论如何这都不起作用。对于Android和Windows,它的工作良好,没有任何例外。仅iOS存在问题。已尝试搜索,但无法找到具有相同行为的内容。
看了这个(Why EFCore 6 does not work on iOS anymore?)和这个(Entity Framework Core in .NET MAUI/Xamarin.Forms)问题没有任何运气。

6g8kf2rb

6g8kf2rb1#

你的iOS系统是什么版本?你是在一台真实的的机器上建造的吗?
但你可以先试试下面的方法:
尝试向.NET Multi-platform App UI(.NET MAUI)应用项目中添加新的授权文件,并向应用项目的Platforms\iOS\文件夹中添加名为Entitlements.plist的新XML文件。然后将以下XML添加到文件中:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

相关问题