PB 2022 1900
I am a newby to this so be kind to me :-)
We are in the process using SnapDevelop to create a wrapper for Zxing but have had some issues around using .NET Standard or .NET Core. When importing the DLL using the .NET DLL Importer we would get errors if compiled using .NET Standard (cannot load file or assembly 'System.Runtime, Version 4.2.2.0 ...'). If it was compiled using .NET Core then it will import but this results in us having to install .NET Core onto machines in order for it to work. We have not done .NET 6 because I thought I read somewhere to not use that one right now.
I do not want a requirement for the customer to load a version of .NET core. We currently have a requirement of .NET framework 4.5 or above so I would say that is my 'target framework'.
Couple questions:
- Why might you choose one framework type over the other?
- What is the correlation of the Framework Type option in the DLL Importer to the target framework in SnapDevelop?
Thanks again,
Chris Craft
If I understand...when importing the DLL:
1) If created with .NET Standard then select .NET Framework
2) If created with .NET 6 then select .NET Core or .Net but since .NET Core is going away I should use .Net
This also leads me to a couple more questions:
1) Since .NET 6 is the only option in the drop down what does that mean if it runs on a machine that has .NET 5 (or 4)?
3) When you say 'OS-agnostic' - are you referring to only the code in SnapDevelop or does that also include the DLL we are writing the wrapper for?
Thanks again!
Chris Craft
According to the documentation, yes, you should select .NET Framework when importing a .NET Standard library. However please keep in mind that .NET Standard 2.1 no longer covers .NET Framework. So if your assembly is targeting this version you might be out of luck here.
"2) If created with .NET 6 then select .NET Core or .Net but since .NET Core is going away I should use .Net"
If the assembly is .NET 6, you must select .NET, if the assembly is .NET Core, you MIGHT select .NET Core or .NET (I haven't tested this). But why would you do that when the .NET Core option is right there
"1) Since .NET 6 is the only option in the drop down what does that mean if it runs on a machine that has .NET 5 (or 4)?"
I doubt .NET 6 assemblies will run in a previous runtime version. However, you might be able to run .NET 4/5 assemblies on .NET 6
"3) When you say 'OS-agnostic' - are you referring to only the code in SnapDevelop or does that also include the DLL we are writing the wrapper for?"
I'm not sure of this myself, I haven't ran into this particular scenario so far so I cannot give advice on this. But my gut feeling tells me that if the C# code itself does not make use of any Windows API and it only interacts with the DLL itself, you can go .NET (not Framework)
Regards - Francisco