Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Failed to create Windows Store build -- can't find DLLs

Discussion in 'Editor & General Support' started by gmatthews, May 24, 2017.

  1. gmatthews

    gmatthews

    Joined:
    Jan 13, 2016
    Posts:
    16
    I can create a normal Windows 64-bit build no problems, however when I try to create a Windows Store build, by pointing the UWP build at the folder of the previously successful Windows build I get this error.

    "errorCS0234: The type or namespace 'X509Certificates' does not exist in the namespace 'System.Security.Cryptography' (are you missing an assembly)

    How come the Windows store build can't find these when the previous normal Windows build can be created and run ok?

    I also get the same message for X509Chain (also in System.Security.Cryptography) and FileSystemEventArgs (in System.IO).

    Windows store Build params: SDK -> Universal 10, target device -> PC, UWP Build Type -> D3D, Build and run on -> local machine
     
  2. ScrappyOrc

    ScrappyOrc

    Joined:
    Nov 25, 2013
    Posts:
    14
    .Net for UWP doesn't include the entirety of .Net, instead it uses .Net core, which doesn't contain X509Certificates. We're running into similar issues in our Unity project. If you're on Unity 5.6 you could try building with IL2CPP, or you could try using 'Windows.Security.Cryptography.Certificates.Certificate' instead of X509Certificate.

    Here's some code we're currently using to try and get around .Net core not including X509Certificates:
    Code (CSharp):
    1. #if NETFX_CORE
    2. using Windows.Security.Cryptography.Certificates;
    3. using X509Certificate = Windows.Security.Cryptography.Certificates.Certificate;
    4. using X509Chain = Windows.Security.Cryptography.Certificates.CertificateChain;
    5. #else
    6. using System.Security.Cryptography.X509Certificates;
    7. #endif
    You'll also need to replace any other X509 class with the 'Windows.Security.Cryptography.Certificates' equivalent.