locked
RTM Known Issue: Application fails WACK compliance because is thinks application is now referencing APIs from Windows.Networking.Vpn RRS feed

  • Question

  • There are no references to Microsoft.Networking.Vpn in an application but WACK still thinks I have code for it. This fails because WACK knows I haven't declared a capability for Vpn.
    Friday, August 7, 2015 1:16 AM
    Moderator

Answers

  • The .NET Native toolchain works very hard to determine ahead of time what code your application may need. Unfortunately, there are a known code patterns that can cause the analysis engine to generate code for your project that you haven’t declared a capability for. One common pattern is asking writing code that utilizes the DefinedTypes() method on the Assembly class to enumerate and find a few types that you may care about. In many of these cases the .NET Native compiler cannot determine that you won’t need code for all of those types and will generate native code for APIs that your application shouldn’t be touching.

    This can be worked around by making an addition to your default.rd.xml file to explicitly exclude those types from consideration. As an example, this line will cause the compiler to skip generating speculative code for types in the Windows.Networking.Vpn namespace:

    <Namespace Name=”Windows.Networking.Vpn” Dynamic=”Excluded” Serialize=”Excluded” Browse=”Excluded” Activate=”Excluded” />

    Friday, August 7, 2015 1:16 AM
    Moderator