Hello,
After few holidays and days of trying to figure it out, well, I still dont find any solution. I try a lot of ideas, none are working.
I'll call official support, but honestly i am a bit lost and out of idea to make it work. For sure i cannot change the architecture of my code for this feature.
Again, everything is working fine when the exe app that load my DLL is my debug app in .Net8
When loading from teststand 24 i got the issue.
So, let's see what i have try:
With better error management and breakpoint, i am able to see that the issues is that we get a type mismatch, and we cannot cast the "type" to the interface.
plugin = (IpluginFoo)Activator.CreateInstance(type);
I force to compile in x64 for CPU and target win-x64 instead of default values (msil?), no effects
With debugguer i compare the type between my manager and my plugin, we got the same Interface (export to file, then win merg tell me no difference)
I found the way to see all dll loaded in memory, i see some differences, like a very important one. When using testsand 24, the C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\netstandard.dll is not loaded 🤣
I was quite happy to see that, well, when i force all the missing assembly, no difference 😖
difference of assembly between native net8 app ond teststand 24
Load them that way:
I haven't yet look inside the NI dll, maybe they redo some in-house dev of very basic code like the Malloc on CVI...
I try to use the option of Activator.CreateInstance, still no effect, still the some invalidcast...
As you can see, the interface name is not just IPlugin as we though with colleagues that this name may be used. So, i rename it to add more words and my company name in it, for sure it is not reuse somewhere else.
I finish by making a very strip down and basique c# project, and same issue.
I join the archive of the simple project + the seq fil that call it
It is a basic feature of c#, i should not be the only one with this issue.