-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Issues with Xamarin.iOS #34
Comments
Hi! Sorry it took some time to answer. I've been on vacation for a couple of weeks 😄 I'm not sure what to do about the unimplemented
All assembly selection overloads goes through the What happens if you remove the |
Hey! Yep, the A workaround is to use |
Thanks for the information! I guess there's nothing more to do than work around it for now and update when the next release is out 😄
Yeah, the problem is that this is futher down the stack. This is actually called by a Microsoft library ( |
@khellang yeah, just had a look and they're using What are you using Microsoft.Extensions.DependencyModel for? From the description on NuGet it's |
Yeah, this API (or even library) wasn't really made with Xamarin in mind. I've only tested it on .NET and .NET Core. The API is basically for when you want to scan for types in your (typically web) application's dependencies. AFAIK, this requires the compilation to actually embed a .deps file in the assembly, which probably doesn't happen on Mono/Xamarin anyway. |
In my case, I'm actually using this in a custom MVVM framework, as it helps with automatically finding views/view models (which I bind together automatically), finding services and working hand in hand with IOC/DI. At any rate, would you mind keeping this issue open until it's fixed in Mono? Just figured others running into the same issue could just check here, and see that it's still "open", even though it's not an issue in Scrutor. :) |
Nope, not at all 😄 There's probably something we can do for Xamarin as well. We can probably cross-compile (will NuGet use the Xamarin-specific assembly instead of netstandard?) and have a different way of getting the referenced assemblies through reflection, similar to what you've already done. |
That's amazing, thank you! |
I'd still like to get to the bottom of why you're not getting any classes registered though. Have you tried |
I'm closing this due to lack of activity. I'm assuming everything sorted itself out with the new methods 😄 |
I've been working on a .NET Standard 2.0 library for a while now, an using Scrutor with
FromApplicationDependencies()
has been working fine in my unit tests.However, when Scrutor is used in Xamarin.iOS both
FromApplicationDependencies()
andFromDependencyContext(DependencyContext.Load(Assembly.GetEntryAssembly()))
throw an exception:I tried getting around this by doing the following:
Unfortunately Scrutor is not finding any classes when I do this. Not sure if it matters, but I specify an array of base types that I scan for, like this:
Note that the debugger is showing that
scanAssemblies
does contain the correct assemblies, and I can see the types I want underDefinedTypes
.Even a hacky workaround would be very much appreciated at this point!
The text was updated successfully, but these errors were encountered: