mono / mono-addins

Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications.
MIT License
164 stars 93 forks source link

Mono.Addins on net6 #205

Closed deanmaoataristocrat closed 1 year ago

deanmaoataristocrat commented 1 year ago

Hi all, does Mono.Addins work on net6 platform. It goes an error, and it worked fine ion older platform (net472), but not net6 platform. Has anyone done it? It supports net standard 2.0, should support net6. Thanks

Got following errors: System.InvalidOperationException: Add-in engine not initialized. at Mono.Addins.AddinEngine.CheckInitialized() at Mono.Addins.AddinEngine.get_Registry() at Mono.Addins.AddinEngine.CheckHostAssembly(Assembly asm) at Mono.Addins.AddinEngine.ValidateAddinRoots() at Mono.Addins.AddinEngine.GetAddin(String id) at Mono.Addins.TreeNode.ResetCachedData() at Mono.Addins.TreeNode.ResetCachedData() at Mono.Addins.TreeNode.ResetCachedData() at Mono.Addins.ExtensionContext.ResetCachedData() at Mono.Addins.AddinEngine.ResetCachedData() at Mono.Addins.Database.AddinDatabase.ResetCachedData() at Mono.Addins.Database.AddinDatabase.Shutdown() at Mono.Addins.AddinRegistry.Dispose() at Mono.Addins.AddinEngine.Shutdown() at Mono.Addins.AddinManager.Shutdown()

slluis commented 1 year ago

Yes, it works on net6. You may be hitting a bug though.

deanmaoataristocrat commented 1 year ago

Yes, it works on net6. You may be hitting a bug though.

Thanks for confirming. I will share my findings if I managed to get it working. :)

deanmaoataristocrat commented 1 year ago

@slluis I think there is a bug in the code for Shutdown. it sets "initialized = false" first then doing disclose() and others, but "registry.Dispose();" will still check it. so it needs to happen at least after registry.Dispose (); image

The code in CheckInitialized will be throwing exception: image

so, we should do the check and clean up first, then set the initialized = false.

can you please make a change and release a new version? we actually need this, I believe it will help others. I have tested it and worked fine. thanks image

slluis commented 1 year ago

Yes, this looks like a bug. I'll fix.

deanmaoataristocrat commented 1 year ago

thanks @slluis

LalitAtAristocrat commented 1 year ago

Hi @slluis, may I ask the tentative timeline for resolving this issue? It will help us plan our changes. Thanks!

deanmaoataristocrat commented 1 year ago

Hi,

Any plan to release a new version for fixing this? Thanks,

Regards,

slluis commented 1 year ago

I'll try to do it this week.

slluis commented 1 year ago

Fixed by https://github.com/mono/mono-addins/pull/208.