Has anyone ever managed to create a VisualStudio.Extensibility extension that uses a Java library with IKVM and IKVM.Maven? #682
Unanswered
martin-honnen
asked this question in
Q&A
Replies: 1 comment 9 replies
-
So, IKVM does not support AppDomains. Because it makes use of native libraries. So any attempt to load it into an AppDomain is likely to fail. The general way to do complicated stuff like this in VS extensions is to do it out of process. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I think there are by now at least three official ways to create a Visual Studio extension, but the latest approach Microsoft has been pushing is Microsoft.VisualStudio.Extensibility, documented with samples in https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples, with videos at https://www.youtube.com/playlist?list=PLReL099Y5nRe25wc_T91FLmTSBlqRgj8J and online at https://learn.microsoft.com/en-us/visualstudio/extensibility/visualstudio.extensibility/visualstudio-extensibility?view=vs-2022.
I have never used that before but over the weekend I have failed to build a simple extension that integrates Saxon HE 12.8 from Maven with IKVM 8.12.0 and IKVM.Maven.Sdk 1.9.3, all I get is FileNotFound errors after my Saxon.HE.dll has been loaded, it appears that the IKVM DLLs are not found (not that you get an exception naming any file but from some debugging with process monitor it seems that IKVM DLLs like IKVM.Java.dll are not found).
A similar but much simpler sample project using the pure .NET SaxonCS NuGet library (currently only available in a commercial enterprise edition) works out fine, so bringing in IKVM breaks the project. The AI tells me it is all due to isolation restrictions that the ServiceHub.Host.Extensibility.x64.exe extension runner imposes and the way the extension is packaged, that might make it hard to get IKVM to work in such a VS extension. Not sure whether that is a good evaluation or just some AI hallucination.
Anyway, before I frustrate myself further trying to get my extension project with IKVM to run at all, I would like to hear whether others here have tried (and managed?) that task, building a Visual Studio 2022 extension based on visualstudio.extensibility that integrates a Java package from Maven with the help of IKVM and IKVM.Maven.Sdk?
Beta Was this translation helpful? Give feedback.
All reactions