WEC2013 GenSdk build error
We recently ran into an issue with generating an SDK for WEC2013. The error message displayed wasn't very helpful:
- Error: GenSdk build error: Error HRESULT E_FAIL has been returned from a call to a COM component.
In Visual Studio 2013 the error looks like this:
With the help of Microsoft we managed to determine the SDK roller (GenSDK) couldn't find some required files and that was causing the failure. The "Build SDK tools" use some input/template files and folders to generate an SDK. It seems that it cannot build an SDK because some files/folders were deleted by the SDK build tools. This is confirmed to be a bug now... To fix this issue we need to regenerate the files and then rename a folder.
Here are the steps to fix this problem for now:
- Regenerate the files
When you build your solution the build process prepares the files needed for SDK generation by copying templates to the $(SG_OUTPUT_ROOT)\misc\sdk
folder.
In my test OSDesign the full path is: $(_WINCEROOT)\OSDesigns\TestCEPC\TestCEPC\Wince800\TestCEPC_x86_Retail\cesysgen\misc\sdk
When you get the error Error: GenSdk build error: Error HRESULT E_FAIL has been returned from a call to a COM component this is because your $(SG_OUTPUT_ROOT)\misc\sdk
folder has been corrupted. To fix this we need to regenerate the correct files. To do this you can either:
- Build your solution. This will generate the files in the correct place
- Copy the files manually
Copy the contents from $(WINCEROOT)\public\common\sdk\msbuild\$(_TGTCPU)\sdk_name
into the $(SG_OUTPUT_ROOT)\misc\sdk\msbuild\sdk_name
folder.
When everything is as it should be, the folder should look like this:
sdk_name
folderWhen the files are in the correct place you need to capitalize the sdk_name
folder. In other words; rename it to SDK_NAME
.
So;
Rename $(SG_OUTPUT_ROOT)\misc\sdk\msbuild\$(_TGTCPUFAMILY)\sdk_name
to $(SG_OUTPUT_ROOT)\misc\sdk\msbuild\$(_TGTCPUFAMILY)\SDK_NAME
.
The reason for this is that the GenSDK managed code uses case-sensitive functions to search for the correct folder name. If the folder name is not all uppercase it will delete it!
When you've renamed the folder you can now build your SDK again and all should be working fine!
Microsoft is currently creating the update that will fix all of the above discovered problems.
DISCLAIMER: This is a workaround, not a final solution. It will be fixed in one of the next updates. Please let me know if you find any issues with this workaround by leaving a comment below, thanks!
Comments
Thanks
Worked for me. Crazy that changing a windows directory name to upper case gets around this bug. This makes me wonder about what test procedures this process had.