Is it possible to inject other dlls

Hello
I was wondering if it's possible to add/inject other dlls. Lets say I would like to do a "workbook" on 3rd party dll

Best Answer

Answers

  • GrahamMurrayGrahamMurray USMember

    Hi, I figured that much out for WPF workbooks, but am trying the same for Android, and while it "appears" to work, in that I get intellisense for the Assembly, I suspect it isn't actually prepping that dll in the patch it applies to the running android app, because as soon as I try to touch one of the types in the loaded assembly, bad stuff happens.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    Correct, this is not supported yet for Android, or for iOS on Windows.

  • GrahamMurrayGrahamMurray USMember

    Specifically, if I try to construct a type from that assembly, the REPL loop just hangs. And if I try to do something along the lines of
    var type = typeof(SomeTypeFromTheAssembly).Name;
    I get an interesting stack trace:
    FileNotFoundException: Could not load file or assembly '/Users/myusername/Documents/MyDll.dll' or one of its dependencies
    at (wrapper managed-to-native) Sbject System.Reflection.Assembly.LoadFrom (bool)
    at Assembly System.Reflection.Assembly.LoadFrom (string assemblyFile)
    at Assembly Xamarin.Interactive.Scripting.ScriptAssemblyContext.HandleAssemblyResolve (object sender, ResolveEventArgs args)
    at Assembly System.AppDomain.DoAssemblyResolve (string name, Assembly requestingAssembly, bool refonly)
    at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<<>d__0> (ref <>d__0 stateMachine)
    at Task . ()
    at Task . (object[] submissionArray)
    at void Xamarin.Interactive.Scripting.ScriptExecutionContext.c__async0.MoveNext ()

    I'm not sure if that code is running in the context of the REPL client?

  • GrahamMurrayGrahamMurray USMember

    Darn, any work around in the short term? Or is this just a wait and see?

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    No, but it's coming very soon.

  • GrahamMurrayGrahamMurray USMember

    Thanks, I'll satisfy myself with messing around with the WPF in the short term :)

  • GrahamMurrayGrahamMurray USMember

    BTW, on the subject of getting the dlls via nuget packages, it would be nice if it supported a local nuget repository?

  • @SandyArmstrong Any news about custom and local repos?

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @AndreasKlapperich none yet! We are working on some nuget improvements though, so I'll keep it in mind.

Sign In or Register to comment.