Arek Kubiak
Arek Kubiak

Reputation: 781

.NET native windows store release

I have problem with release version of my application. After retarget windows store app to universal windows platform project i can't run application in release mode with Compile with .NET Native tool chain option checked.

I get an error:

Exception thrown: System.Reflection.MissingRuntimeArtifactException in System.Private.Reflection.Core.dll

Additional information: MakeGenericMethod() cannot create this generic method instantiation because the instantiation was not metadata-enabled: System.Linq.Enumerable.Distinct<System.Char>(System.Collections.Generic.IEnumerable<System.Char>) For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868

When i disable Compile with .NET Native tool chain application is working and doesn't throw a exception. Generally this is solution, but in Windows App Certification Kit i get failed result with errors (Test Supported API):

·API ExecuteAssembly in uwphost.dll is not supported for this application type. App.exe calls this API. ·API DllGetActivationFactory in uwphost.dll is not supported for this application type. App.exe has an export that forwards to this API. ·API OpenSemaphore in ap-ms-win-core-synch-11-1-0.dll is not supported for this application type. System.Threading.dll calls this API. ·API CreateSemaphore in api-ms-win-core-kernel32-legacy-11-1-0.dll is not supported for this application type. System.Threading.dll calls this API.

Someone can help?

Upvotes: 5

Views: 882

Answers (1)

Jerry Nixon
Jerry Nixon

Reputation: 31813

The .NET Native runtime doesn't include a JIT compiler. As a result, all necessary native code must be generated in advance. A set of heuristics is used to determine what code should be generated, but these heuristics cannot cover all possible metaprogramming scenarios. Therefore, you must provide hints for these metaprogramming scenarios by using runtime directives. If the necessary metadata or implementation code is not available at runtime, your app throws a MissingMetadataException, MissingRuntimeArtifactException, or MissingInteropDataException exception. Two troubleshooters are available that will generate the appropriate entry for your runtime directives file that eliminates the exception:

  • The MissingMetadataException troubleshooter for types.
  • The MissingMetadataException troubleshooter for methods.

See here: https://msdn.microsoft.com/en-us/Library/dn600640%28v=vs.110%29.aspx

Upvotes: 0

Related Questions