11-18-2021 07:41 AM
I'm having issues upgrading to SharpPcap V6.1.0 (https://www.nuget.org/packages/SharpPcap/).
SharpPcap is a .NET Standard 2.0 assembly.
I'm getting "An error occirred trying to load the assembly.". The assembly and all of it's dependencies are located in a directory at the same level as my project file containing the referencing lvclass.
I've added a .config file at LabVIEW.exe and .lvproj level with the following content to allow remote sources;
<?xml version ="1.0"?>
<configuration>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>
The assembly packages were downloaded though MS VS Community 2020. Using VS I'm able to run an example (Example3.BasicCap ) compiling against .NET Framwork -> net48.
What am I doing wrong?
Solved! Go to Solution.
11-18-2021 12:38 PM
At the moment it seems to work, but I'm not sure yet why. I created an wrapper assembly in VS and after building it it had also dumped all referenced assemblies and the proper versions thereof alongside my wrapper assembly.
I saved a test project and Vi in the same directory and could load the SharpPcap functions without needing my wrapper assembly.
So all in al it seems I initially selected the wrong combination of dependencies, it's a mix of .NET Standard libraries and .Net framework versions.
I'll update this thread once I have a more definite operating procedure to select the proper set of dependencies and a .NET standard library.
I didn't need to create a .config file to make it work.
11-19-2021 08:47 AM
The final solution involves Visual Studio and an .lvproj.config file.
Visual Studio is used to create the list of assemblies with the proper version and target framework.
This proofed to be a mix of .NET standard 2.x, .NET framework 4.x and .NET 5.0 assemblies.
For one particular assembly the .config file was required at lvproj level and probably also at executable level to do a binding redirect to a particular version of "System.Runtime.CompilerServices.Unsafe.dll".
07-05-2025 09:33 AM
Hi,
This is solved in LabPcap: