I am using pythonnet to import C# dll files. (IDE: Visual Studio Code)
I have added the references and the codes do not give an error,
but when I try to use one of the classes from the references it gives this error:
System.IO.FileNotFoundException: Could not load file or assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I searched the reason for this problem and found out that this error can occur when I try to reference dll files that is made from different .NET version of what I am using.
So when I tried installing .NET Framework 4.0 but I found out that it was already installed.
I tried changing the .NET version (I was using .NET 7.0) to .NET Framework 4.0 (4.8) but I do not know how to do it in python environment.
So I have few questions:
How can I change the .NET version in pythonnet using Visual Studio Code?
Is the error occuring not because of the version difference? If so, why is it occuring?