Could not load file or assembly 'Samsung.Sap' Debug/Visual Studio

I am creating a Tizen.NET wearable app using Tizen.NET 4.0 in Visual Studio 2019. During debugging, when attempting to use a function that uses Samsung SAP, the app crashes with ‘Frame not in module’ error in Visual Studio - which doesn’t really explain much. There’s no further exception information.

I’ve tried the advice elsewhere around ticking Common Runtime Exceptions settings in Visual Studio, but it makes no difference. Reviewing the log for the device, I can however see the below error. This could be the problem but I’m not sure how to solve it? (I’m deploying my app to a real watch, not an emulator if that makes a difference).

12-25 15:13:34.369 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : monitor dir /opt/usr/home/owner/share/.elementary/config/wearable
12-25 15:13:48.879 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : Unhandled Exception: 
12-25 15:13:49.419 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : System.IO.FileNotFoundException: Could not load file or assembly 'Samsung.Sap, Version=, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
12-25 15:13:49.419 : Info / DOTNET_LAUNCHER ( 4670 : 4677 ) : eApp1.Program.Main(String[] args) in C:\Users\james\source\repos\TizenWearableApp1\TizenWearableApp1.cs:line 21

EDIT: I’ve even tried manually copying into C:\Users\james\source\repos\TizenWearableApp1\bin\Debug\tizen40\tpkroot\bin before deploying to the watch to test.

EDIT AGAIN: It would seem I’m not the only one with this issue? - Add Samsung.Sap dll to project

Hello @lupinegarou,

I am very sorry to hear about your issue. Please ensure that the necessary Nuget Packages are installed on your project and add the required privileges in your manifest file. Guidelines for integrating SAP into your project can be found from here.

I hope this will help resolve your issue. To reduce complexity you can try integrating SAP on a blank project before moving on to your existing project.

PS: If you find this answer helpful please press the “like” button so that others can find it more easily.

Best Regards,
Samsung Developer Program