9
votes

I have a UWP project included as part of my Xamarin.Forms solution. When running the Windows App Cert Kit locally, it passes without any issues.

When submitting my app to the store, it fails the certification process with the following error:

Error Found:

The supported APIs test detected the following errors:

API FindFirstFileEx in api-ms-win-core-file-l1-2-0.dll is not supported for this application type. PInvoke.Kernel32.dll calls this API.

Impact if not fixed:

Using an API that is not part of the Windows SDK for Windows Store apps violates the Windows Store certification requirements.

How to fix:

Review the error messages to identify the API that is not part of the Windows SDK for Windows Store apps. Please note, apps that are built in a debug configuration or without .NET Native enabled (where applicable) can fail this test as these environments may pull in unsupported APIs. Retest your app in a release configuration, and with .NET Native enabled if applicable.

I have verified that my app runs in Release mode, and have verified my UWP build settings:

uwp

I tried contacting Microsoft's Chat support, but was redirected to enter an Incident Report, where I was then redirected to just ask for help on a forum or pay for advanced tech support, so I haven't been able to get any more information about whether this is a valid failure or not.

Based on the documentation found on FindFirstFileEx (https://msdn.microsoft.com/en-us/library/windows/desktop/aa364419(v=vs.85).aspx), it looks like it is supported by Windows Desktop, Store apps, and Windows Phone. My UWP app was submitted to support Desktop and Mobile families, which seems to be included in the supported clients of this function, so it is unclear as to what is causing the failure.

Any ideas on where to go from here?

4
I was informed today by Microsoft support that this issue has been corrected. After resubmitting, my apps appear to have passed certification now as they are in "Publishing" status.Taylor Buchanan

4 Answers

6
votes

Update August 14 2017: This problem should now be resolved in the Store. Please try to re-submit your apps if you hit this issue.


This is a problem in the way the WACK scan is running in the Store, and how it integrates with .NET Native.

For some background, Windows doesn't actually have an API named FindFirstFileEx - it doesn't exist. And the way the WACK's supported API scan works is that it looks at all the APIs you call and verifies if one of the following is true:

  1. It's an API exported by another DLL in your package
  2. It's an API explicitly mentioned in the allow-list

In the case of kernel32.dll!FindFirstFileEx, WACK sees that kernel32.dll doesn't exist in your package so it has to check the allow-list. The allow list doesn't mention FindFirstFileEx because it doesn't exist. Here's what does exist:

C:\Program Files (x86)\Windows Kits\10\App Certification Kit>findstr FindFirstFileEx SupportedAPIs-x64.xml
    <API Name="FindFirstFileExA" ModuleName="api-ms-win-core-file-l1-1-0.dll"/>
    <API Name="FindFirstFileExA" ModuleName="api-ms-win-core-file-l1-2-0.dll"/>
    <API Name="FindFirstFileExA" ModuleName="api-ms-win-core-file-l1-2-1.dll"/>
    <API Name="FindFirstFileExA" ModuleName="api-ms-win-core-file-l1-2-2.dll"/>
    <API Name="FindFirstFileExA" ModuleName="api-ms-win-downlevel-kernel32-l1-1-0.dll"/>
    <API Name="FindFirstFileExW" ModuleName="api-ms-win-core-file-l1-1-0.dll"/>
    <API Name="FindFirstFileExW" ModuleName="api-ms-win-core-file-l1-2-0.dll"/>
    <API Name="FindFirstFileExW" ModuleName="api-ms-win-core-file-l1-2-1.dll"/>
    <API Name="FindFirstFileExW" ModuleName="api-ms-win-core-file-l1-2-2.dll"/>
    <API Name="FindFirstFileExW" ModuleName="api-ms-win-downlevel-kernel32-l1-1-0.dll"/>
    <API Name="FindFirstFileExA" ModuleName="kernel32.dll"/>
    <API Name="FindFirstFileExW" ModuleName="kernel32.dll"/> 

Note there are a bunch of entries for FindFirstFileExA and FindFirstFileExW, which are the APIs that actually exist. Whenever your app tries to call FindFirstFileEx, it's actually calling one of these instead.

For C / C++ developers, the pre-processor actually replaces FindFirstFileEx with the A or W version based on the existence of the UNICODE macro.

For .NET developers, the JIT runtime (or, in .NET Native's case, the compiler) figures out whether to call the A or W version based on the specifics of the DllImport attribute, such as the values of the CharSet and ExactSpelling properties.

And herein lies the problem - at the moment, WACK in the Store is running on .NET assemblies before the compiler has substituted the non-suffixed version with the correct suffixed version. When you run WACK on your development machine, it correctly checks the assembly after the compiler has made the substitution, so you see no errors.

The first part of the fix (which is in the works) is to add the non-suffixed versions to the allow-list. The second part of the fix is to make sure WACK runs on the post-compiled bits.

3
votes

I had the same problem. I opened a chat session (from the dev center), as Peter Torr suggested.

Here is the summary:

Me: My app update is stuck because you have a bug in your certification system. See here: UWP app submission failure due to unsupported API FindFirstFileEx (WACK passes locally)

Support: We are aware of the issue, and are working towards a resolution. I apologize for the inconvenience

Me: Ok, I understand that you are working on the bug. But in the meantime, you could let my app pass, right?

Support: We have a temporary workaround. I can get that info for you if you'd like?

... some minutes later ...

Support: Ok so what I'll need you to do is resubmit your package but include this number XXXXXXXXXXX in the notes for cert section. If that does not work and you app fails cert again, submit feedback on the most recent failed cert report and again insert the number there. I've notated your account to reflect this as well

(real number replaced by XXXXXXXXXXX)


Update 1: Just like @jkh, the automatic certification failed again despite of the number. So I posted the number in a certification feedback.

Update 2: Unfortunately, the "solution" did not help. I now have written an e-mail to the one from the chat support (I got his address after the chat). I am not very confident that this helps. But let's see...

Update 3: I also submitted an incident. (This can be done where you normally start a chat session, but use the button "Submit incident" below.)

Update 4: Answer from incident submission:

Thank you for contacting Developer Support. I understand you have failed certification due to Window Store Policy 15.1 per the API error. After further review I wanted to let you know this is a known issue and currently being worked on a fix by engineers. There should be a fix being rolled out soon and ask that you please wait. If the fix is not implemented by Monday I can have this issue looked into further but since this is a global issue I would recommend to wait for the fix to be rolled out. The moment I hear something as it pertains to the fix I will be sure to reach out and ask that you please try again for certification.

Update 5: I re-submitted my update and I am now waiting for the result.

Update 6: Failed again...

Update 7: Response from incident submission: This is still an ongoing issue and have escalated your issue to our Internal team for further investigation to try and bypass this error for you. Once I receive an update I’ll be sure to reach out.

Update 8: Eventually, after re-submitting, the certification process took two days (!), but now my update is in the store. Wow, what a fight...

1
votes

I'm facing the same problem. Have submitted a certification feedback report, awaiting some response from Microsoft...

0
votes

After opening a ticket with Microsoft a few weeks ago I have finally been provided a waiver on my account that allowed me to pass the automated certification.

DO NOT RESUBMIT. I had been told to resubmit and provide certification report feedback on that solution. After resubmitting a few times, I received email responses that my submission had been manually passed, but these submissions had been deleted each time that I resubmitted, so my app still had not been pushed through.

One submission with the number you receive from Microsoft support included in the Notes for Certification and the Certification Report Feedback and with a ticket open with Microsoft will eventually get your submission passed.