Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Linking C# code with Enclave code

Vaurine
Beginner
1,161 Views

I need to call some sgx methods in my C# code. I have found simple example with C# SGX integration on this page: https://software.intel.com/content/www/us/en/develop/articles/csharp-application-with-intel-software-guard-extensions.html. I try to rewrite it on my personal project, and everything builds fine. Unfortunately, when I am calling linker class SigningEnclaveLinkManaged enclave = new SigningEnclaveLinkManaged(), program returns following exception:

System.IO.FileNotFoundException
HResult=0x8007007E
Message=Cannot load a file or set 'SigningEnclaveLink.dll' or one of its dependencies. A specific module cannot be found.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>

What can be the issue of that?  Do I need to check something in project options? There are only problems with Linker Class, SGX Support Detection Class works fine.

 

 

0 Kudos
1 Solution
Vaurine
Beginner
1,113 Views

Reference was added before by me so that it was not the case. I fixed this bug to compare project settings of my Project and sample project. I had to change "Output Path" in C# Project Properties to "..\x64\Debug\". Now it works.

View solution in original post

3 Replies
JesusG_Intel
Moderator
1,122 Views

Hello Vaurine,


Is your SigningEnclaveLinkManaged the equivalent of SMSSenderEnclaveLink from the example?


If so, you need to add the SigningEnclaveLinkManaged project as a reference in your main app project. Your main application does not know where to find the SigningEnclaveLinkManaged dll unless you tell it where it is.


Right click on your main application -> Add -> Reference.. -> select SigningEnclaveLinkManaged.


0 Kudos
Vaurine
Beginner
1,114 Views

Reference was added before by me so that it was not the case. I fixed this bug to compare project settings of my Project and sample project. I had to change "Output Path" in C# Project Properties to "..\x64\Debug\". Now it works.

JesusG_Intel
Moderator
1,096 Views

This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.


0 Kudos
Reply