Guidance to ensure the build events in the "mrsigner" and "sp" projects find the required files
- Compiled the sgx-ra-sample solution in Visual Studio*
- Received errors from projects:
mrsigner:
The command ""sgx-ra-sample\vs\x64\Debug\mrsigner.exe" x64\Debug\enclave_sigstruct_raw > x64\Debug\enclave_mrsigner.txt
: error MSB3073: :VCEnd" exited with code 1.sp:
Get-Content : Cannot find path 'sgx-ra-sample\vs\service-provider\policy.in' because it does not exist.
In project mrsigner, go to the Post-Build Event and change $(IntDir) to $(OutDir).
- Select project mrsigner -> Properties -> Build Events -> Post-Build Event.
- Edit Command Line: "$(TargetPath)" $(OutDir)enclave_sigstruct_raw > $(OutDir)enclave_mrsigner.txt.
In project sp, go to the Pre-Build Event and add ..\ to policy.in.
- Select project sp -> Properties -> Build Events -> Pre-Build Event.
- Edit Command Line: powershell -command "$mrs=Get-Content -Path ..\mrsigner\$(IntDir)enclave_mrsigner.txt; ( ( Get-Content -Path ../policy.in -Raw ) -replace '@MRSIGNER@',$mrs ) | Set-Content $(IntDir)policy.cmd".
The default PowerShell* command in the Pre-Build Event of project sp is not able to find the policy.in file.
The default location of policy.in is under sgx-ra-sample/vs/policy.in.
During the pre-build event, the PowerShell command is executed from the sgx-ra-sample/vs/service-provider directory. Accordingly, place ../ in front of policy.in in the PowerShell command line so that it can find policy.in one level up.
So, knowing that the PowerShell command runs in sgx-ra-sample/vs/service-provider, tell the PowerShell command the correct relative path to policy.in if it is not in the default location.