0

The project is a Class Library which I want to use it from a Visual Foxpro application. Visual Foxpro is 32bit.

.Net project:

  • Target framework .Net Framework 4.7.2
  • Target Platform x86.
  • Using Newtonsoft.Json and RestSharp

I registered the DLL using RegAsm and I am able to create an object of that from Visual Foxpro. Things are fine, if I simply do some string manipulation and I am getting return value from DLL into Visual Foxpro program.

Now, when I enable RestSharp, it breaks and throws below error:

*OLE IDispatch exception code 0 from System.Memory: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified... * I am not sure how this version conflict came up when I installed packages afresh and have not copied any file manually.

Any clue?

Thanks in advance Rajesh

My Visual Foxpro test folder is different and I have copied all files from my .Net Debug folder into that folder.

  • You may not have that DLL accesible from GAC. You could try register ir with gacutils. Or try putting it in the .exe folder. – gonzalorf Oct 31 '22 at 14:01
  • Use Fusion++ to create a log of what assemblies .NET Framework is trying to load and where it is looking for them: https://github.com/awaescher/Fusion/releases – Christof Wollenhaupt Nov 10 '22 at 09:40
  • @gonzalorf, my test folder is different where I have my Visual Foxpro program. Each time I build .Net DLL, I copy all files from my Debug folder to this test folder. So, as you assume, it should find the DLL there, isn't it? – Rajesh Karunakaran Nov 11 '22 at 05:54
  • @ChristofWollenhaupt, thank you. Let me check and learn to use that. – Rajesh Karunakaran Nov 11 '22 at 05:55

0 Answers0