Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samples only work if 'install' is built #10

Open
mschofie opened this issue Nov 15, 2024 · 0 comments
Open

Samples only work if 'install' is built #10

mschofie opened this issue Nov 15, 2024 · 0 comments

Comments

@mschofie
Copy link
Member

The CMake build scripts have logic to copy the necessary runtime dependencies from the 'Microsoft.Attestation.Client' NuGet as 'install' steps (here):

    install(
        FILES "${ATTEST_PACKAGE_DIR}/bin/azure-attest-manager.dll" "${ATTEST_PACKAGE_DIR}/bin/AzureAttestManager.dll" "${ATTEST_PACKAGE_DIR}/bin/AzureAttestNormal.dll"
        DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
    )

If I try and build and run from Visual Studio, the build doesn't appear to build the 'install' target, so the dependencies are missing, and the samples fail with a message box:

---------------------------
attestation-sample_boot_att.exe - System Error
---------------------------
The code execution cannot proceed because azure-attest-manager.dll was not found. Reinstalling the program may fix this problem. 
---------------------------
OK   
---------------------------

"install(...)" steps only run if the 'install' target is build. I couldn't find a way to build the 'install' target from Visual Studio (the only targets I can find are in the "Select Startup Item" split-button on the toolbar, and that appears to only offer executable targets), so I built from CMake and that copied the files as expected:

cmake --build --preset x64-debug --target install
[4/5] Install the project...-- Install configuration: "Debug"
-- Installing: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/azure-attest-manager.dll
-- Installing: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/AzureAttestManager.dll
-- Installing: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/AzureAttestNormal.dll
-- Up-to-date: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/azure-attest-manager.dll
-- Up-to-date: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/AzureAttestManager.dll
-- Up-to-date: Q:/Source/github/microsoft/Attestation-Client-Samples/out/build/x64-debug/attestation/AzureAttestNormal.dll

And then the sample will launch from Visual Studio. So:

  1. If there's a way to run the 'install' target from Visual Studio, it would help if README.md called that out.
  2. TBH, it might just be easier to copy the files into the build output path during configuration, not at install-time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant