0

My problem is very similar to the one described here: Could not load file or assembly 'Sage_SA.Work

However, the file/assembly that is supposedly unable to be loaded in my case is Sage_SA.SDK (and not Sage_SA.Work).

Just like in the other case, I downloaded the Sage 50 SDK (Simply Accounting) that has the C# example code to run, and the example code worked fine. I was able to connect to my local "company" (I have the 30-day trial version). I copied the SDK from that example project, along with the other dll's that are used in that project.

When I copy the code to connect to the database:


           if (SDKInstanceManager.Instance.OpenDatabase([required params here]))
           {
               SageUtility.InitializeAfterDatabaseOpen();
           }

I get the following exceotion message:

"Could not load file or assembly 'Sage_SA.SDK, Version=29.0.0.4, Culture=neutral, PublicKeyToken=17d2fa970cd68de9'. The system cannot find the file specified.":"Sage_SA.SDK, Version=29.0.0.4, Culture=neutral, PublicKeyToken=17d2fa970cd68de9"

What is weird is that this exception is thrown when I try to accessing SDKInstanceManager.Instance, however I have no problem access some of the properties in that SDKInstanceManager class (e.g.,: SDKInstanceManager.NUMBEROFBOOKS).

Anyone has thoughts about the possible source of the error, and how it can be fixed?

Thanks.

  • If the `Sage_SA.SDK.dll` present in your application directory? Does it have the correct assembly version? – Klaus Gütter Nov 19 '22 at 05:37
  • Yes and yes. But I just realized I mistakenly created a .NET Core Console Application, while I actually needed a .NET Framework application. In a .NET Framework project, it works fine. Thanks for your help. – SugarCoding Nov 20 '22 at 14:33

1 Answers1

0

For future readers with the same problem: in my case, the problem was that I had mistakenly created a .NET Core Application instead of a .NET Framework Application. After switching to .NET Framework, it worked fine!