I copied the SampleEnaclave application (entire code) with different name so that i can start making changes to it, but if i run this new app then i get following error.
"Error: Invalid enclave metadata."
How do i debug this? and what could be the issue here?
SGX_ERROR_INVALID_METADATA means that the "The metadata embedded within the enclave image is corrupt or missing."
If you have renamed the project, maybe you should check this line of code to see whether it matches the new name:
# define ENCLAVE_FILENAME "Enclave.signed.dll"
Check the DLL for its size to see whether the DLL has the same size of the original.
Finally, check the working directory to make sure it points to the right directory where the DLL should reside in.