C# 将StructureMap与Xamarin.Forms一起使用

C# 将StructureMap与Xamarin.Forms一起使用,c#,xamarin.forms,structuremap,C#,Xamarin.forms,Structuremap,我正在开发一个基于Xamarin表单的跨平台应用程序。 在我的应用程序中,我想为IoC使用StructureMap 我做了一个申请样本。一旦我添加StructureMap包4.6.1,部署时就会出现错误: 正在同步文件。。。建设和运行。。。内置1条消息。 1,1:错误:无法从流加载程序集: System.AggregateException:发生一个或多个错误。--> System.AggregateException:发生一个或多个错误。--> System.IO.DirectoryNotFo

我正在开发一个基于Xamarin表单的跨平台应用程序。 在我的应用程序中,我想为IoC使用StructureMap

我做了一个申请样本。一旦我添加StructureMap包4.6.1,部署时就会出现错误:

正在同步文件。。。建设和运行。。。内置1条消息。 1,1:错误:无法从流加载程序集: System.AggregateException:发生一个或多个错误。--> System.AggregateException:发生一个或多个错误。--> System.IO.DirectoryNotFoundException:找不到 路径 /data/user/0/com.xamarin.live/files/External/.nuget/packages/system.runtime.loader/4.3.0/ref/netstandard1.5/system.runtime.loader.dll。 在System.IO.FileStream..ctor System.String路径中,System.IO.FileMode 模式,System.IO.FileAccess访问,System.IO.FileShare共享, System.Int32 bufferSize,System.Boolean匿名, 中的System.IO.FileOptions选项[0x0017d] :0位于System.IO.FileStream..ctor System.String路径、System.IO.FileMode模式、System.IO.FileAccess 访问,System.IO.FileShare共享[0x00000] :0在包装器处 使用check System.IO.FileStream进行远程调用:.ctor 字符串,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare 位于中的System.IO.File.OpenRead System.String路径[0x00000] :0 at .$LocalFileSystem+Upsight IFileSystem-OpenReadAsync@49-1.在0中调用[0x00012] 中的System.Threading.Tasks.Task1[TResult].InnerInvoke[0x0000f] :0 at 中的System.Threading.Tasks.Task.Execute[0x00010] :0-内部异常结束 堆栈跟踪--内部异常堆栈跟踪的结束-- -->内部异常0 System.AggregateException:发生一个或多个错误。-->System.IO.DirectoryNotFoundException:无法找到 找到路径的一部分 /data/user/0/com.xamarin.live/files/External/.nuget/packages/system.runtime.loader/4.3.0/ref/netstandard1.5/system.runtime.loader.dll。 在System.IO.FileStream..ctor System.String路径中,System.IO.FileMode 模式,System.IO.FileAccess访问,System.IO.FileShare共享, System.Int32 bufferSize,System.Boolean匿名, 中的System.IO.FileOptions选项[0x0017d] :0位于System.IO.FileStream..ctor System.String路径、System.IO.FileMode模式、System.IO.FileAccess 访问,System.IO.FileShare共享[0x00000] :0在包装器处 使用check System.IO.FileStream进行远程调用:.ctor 字符串,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare 位于中的System.IO.File.OpenRead System.String路径[0x00000] :0 at .$LocalFileSystem+Upsight IFileSystem-OpenReadAsync@49-1.在0中调用[0x00012] 中的System.Threading.Tasks.Task1[TResult].InnerInvoke[0x0000f] :0 at 中的System.Threading.Tasks.Task.Execute[0x00010] :0-内部异常结束 堆栈跟踪-- -->内部异常0 System.IO.DirectoryNotFoundException:找不到路径的一部分 /data/user/0/com.xamarin.live/files/External/.nuget/packages/system.runtime.loader/4.3.0/ref/netstandard1.5/system.runtime.loader.dll。 在System.IO.FileStream..ctor System.String路径中,System.IO.FileMode 模式,System.IO.FileAccess访问,System.IO.FileShare共享, System.Int32 bufferSize,System.Boolean匿名, 中的System.IO.FileOptions选项[0x0017d] :0位于System.IO.FileStream..ctor System.String路径、System.IO.FileMode模式、System.IO.FileAccess 访问,System.IO.FileShare共享[0x00000] :0在包装器处 使用check System.IO.FileStream进行远程调用:.ctor 字符串,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare 位于中的System.IO.File.OpenRead System.String路径[0x00000] :0 at .$LocalFileSystem+Upsight IFileSystem-OpenReadAsync@49-1.在0中调用[0x00012] 中的System.Threading.Tasks.Task`1[TResult].InnerInvoke[0x0000f] :0 at 中的System.Threading.Tasks.Task.Execute[0x00010]
:0我建议您不要在Xamarin.Forms上使用StructureMap,因为它不受支持:

StructureMap 4.5+无法在Xamarin iOS上运行,因为它依赖于 System.Reflection.Emit,在MonoTouch中不可用。 StructureMap 4.4至少适用于该平台上的基本场景。 核心StructureMap团队中目前没有人与Xamarin合作 移动运行时,但我们对验证上的StructureMap感兴趣 如果有志愿者有兴趣帮助我们,我们将提供新的平台


好啊那么EntityFrameworkCore SQLite呢?同样的?Sqlite是受支持的,但我不确定ef核心。