In my C# project (VS 2022) I had to downgrade a nugget package (OPCLabs.EasyOPC) to an older version due to some functional problems on the new version. Therefore I have uninstalled the nugget package (V5.71) and installed the older version (V5.62).
I can also confirm from the packages under the project tree that 5.62 is installed, and 5.71 is not existing anymore.
After clean and rebuild the project without any Errors, I get when I use a function of the library the Error:"The system cannot find the file specified.File name: 'OpcLabs.EasyOpcClassicCore, Version=5.71.401.1, Culture=neutral, PublicKeyToken=6faddca41dacb409'"
So it is looking for a file of the version that I have uninstalled. I think this is more a problem of Visual Studio 2022 , then a problem of the library, because I could work with the older version without problem in the past.
What can I do? Do I have to remove some rest files manualy?
My Code: (I get the Error as soon as my function is called)
using OpcLabs.EasyOpc; using OpcLabs.EasyOpc.DataAccess; using OpcLabs.EasyOpc.OperationModel; private async Task Browse_OPC_Servers() { var client = new EasyDAClient(); client.InstanceParameters.EnableNetApiClient = false; ServerElementCollection serverElements; try { serverElements = client.BrowseServers("10.92.XXX.XXX"); } catch (OpcException opcException) { Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message); Console.ReadLine(); return; } foreach (ServerElement serverElement in serverElements) { Console.WriteLine($"ServerElements(\"{serverElement.ClsidString}\").ProgId: {serverElement.ProgId}"); } Console.ReadLine(); }