Article ID: 000087410 Content Type: Error Messages Last Reviewed: 09/22/2021

Received Error "MSB3073" from the Build Events in the mrsigner and sp Projects when Compiling the sgx-ra-sample in Visual Studio*

Environment

Windows_10

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Guidance to ensure the build events in the "mrsigner" and "sp" projects find the required files

Description
  • 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.

Resolution

In project mrsigner, go to the Post-Build Event and change $(IntDir) to $(OutDir).

  1. Select project mrsigner -> Properties -> Build Events -> Post-Build Event.
  2. 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.

  1. Select project sp -> Properties -> Build Events -> Pre-Build Event.
  2. 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".
Additional information

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.

Related Products

This article applies to 1 products