Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container.Resolve<T>craches on iOS #187

Closed
VladislavAntonyuk opened this issue Oct 25, 2019 · 7 comments
Closed

container.Resolve<T>craches on iOS #187

VladislavAntonyuk opened this issue Oct 25, 2019 · 7 comments

Comments

@VladislavAntonyuk
Copy link

/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection.Emit/DynamicMethod.notsupported.cs:64
ExpressionCompiler.TryCompileBoundToFirstClosureParam (System.Type delegateType, FastExpressionCompiler.LightExpression.Expression bodyExpr, System.Collections.Generic.IReadOnlyList`1[T] paramExprs, System.Type[] closurePlusParamTypes, System.Type returnType)
FactoryDelegateCompiler.CompileToFactoryDelegate (FastExpressionCompiler.LightExpression.Expression expression, System.Boolean useFastExpressionCompiler, System.Boolean preferInterpretation)
IResolver.Resolve (System.Type serviceType, DryIoc.IfUnresolved ifUnresolved)
Resolver.Resolve[TService] (DryIoc.IResolver resolver, DryIoc.IfUnresolved ifUnresolved)

@dadhi
Copy link
Owner

dadhi commented Oct 26, 2019

What is DryIoc version?

@dadhi
Copy link
Owner

dadhi commented Oct 26, 2019

Try the solution from here
#156

@VladislavAntonyuk
Copy link
Author

@dadhi latest preview. I have also tried with version 4.0.0. The same behavior. I will try your solution #156

@VladislavAntonyuk
Copy link
Author

Also related issue: #130
container = new Container(rules => rules.WithUseInterpretation()); solves the issue. Is there any impact on performance if I run it on non iOS devices?

@dadhi
Copy link
Owner

dadhi commented Oct 26, 2019

Maybe 4 times slower on 3rd and more resolutions (tested in this benchmark https://github.com/dadhi/DryIoc/blob/8e8aa8bd710f5a0d0a8ad14f457ea419fd5eb562/playground/Playground/RealisticUnitOfWorkBenchmark.cs)

If possible, I would suggest to use platform #if-def or set this option after checking platform runtime capability.

@dadhi
Copy link
Owner

dadhi commented Oct 26, 2019

Using somth like this RuntimeInformation.IsOSPlatform(OSPlatform.OSX) or using IsDynamicCompilationSupported from the .Net Core 3.

I am personally not developing for iOS, so would be intesting to hear, what in the end did worked for you.

@VladislavAntonyuk
Copy link
Author

OK, thank you, I am closing the issue and will reply to the related one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants