locked
sni.dll has failed the AppContainerCheck check RRS feed

  • Question

  • Hello,

    I have created an UWP application for Windows 10 Fall Creators update (16299) with EF Core and Microsoft SQL.
    This all works great when testing the application using debug or deploy from Visual Studio. But if I create a package for the app store I get a validation failure. The app then also doesn't connect to the database (screen turns red in my example).
    Can anybody help, I'm at a loss?

    Example code

    public MainPage()
    {
        this.InitializeComponent();
    
        try
        {
            using (DBTestContext testDB = new DBTestContext())
            {
                testDB.Database.OpenConnection();
            }
    
            // Green
            this.MainGrid.Background = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0));
        }
        catch
        {
            // Red
            this.MainGrid.Background = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
        }
    }

    Validation error in text:

    • File C:\Program Files\windowsapps\****************_1.0.0.0_x64__79e7p26z62emy\sni.dll has failed the AppContainerCheck check.




    • Edited by Martijn1985 Monday, January 29, 2018 7:00 PM
    Monday, January 29, 2018 4:54 PM

Answers

  • I can confirm that the prerelease System.Data.SqlClient 4.5.0-preview2-25707-02 does work. Hopefully when 4.5 comes out official this problem will be solved.

    Same goes for Microsoft.EntityFrameworkCore.SqlServer 2.1.0-preview2-30002

    • Marked as answer by Martijn1985 Thursday, February 1, 2018 12:17 PM
    Thursday, February 1, 2018 12:17 PM

All replies

  • I still haven't found out why the certification is failing on the sni.dll
    But I have figured out it has nothing to do with SQL not connecting. Apperently this is because local (loopback) connections aren't allowed by default.

    This command solved my connection issue:
    CheckNetIsolation.exe LoopbackExempt –a –n={appname}

    All credits for solving this go to bricelam
    More info: https://github.com/aspnet/EntityFrameworkCore/issues/10804#issuecomment-361424723


    Tuesday, January 30, 2018 7:24 AM
  • Hi Martjin,

    Do you build your app using the latest compiler and linker?

    Also, for the supported API test failure, you need to compile your app in release build and then generate the package or it could fail this test.

    For more details, you could refer to AppContainerCheck and Supported API test.

    Best regards,

    Zhendong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 30, 2018 9:49 AM
  • Hello Zhendong,

    I'm using Visual Studio 2017 15.5.6, which should be the latest version. And am building the solution in release build.

    This is a screenshot of my build settings.

    Tuesday, January 30, 2018 1:43 PM
  • For testing purposes I installed Visual Studio 2017 15.5.6 on another machine. Created a new empty UWP app. After adding System.Data.SqlClient the validation starts failing with "sni.dll has failed the AppContainerCheck check"
    I have tested the following versions of the package
    4.4.2
    4.4.1
    4.2.0
    4.1.0

    Everything seems to work in the package, but it won't pass the store validation.
    Wednesday, January 31, 2018 2:54 PM
  • I can confirm that the prerelease System.Data.SqlClient 4.5.0-preview2-25707-02 does work. Hopefully when 4.5 comes out official this problem will be solved.

    Same goes for Microsoft.EntityFrameworkCore.SqlServer 2.1.0-preview2-30002

    • Marked as answer by Martijn1985 Thursday, February 1, 2018 12:17 PM
    Thursday, February 1, 2018 12:17 PM
  • Hello,

    I have exactly the same issue! For me it looks like, the System.Data.SqlClient package  isn't coded properly!
    It was announced, that it will support UWP applications, (what it doe's) but it fails on there own Certification process!!

    I have opened a case on Microsoft Customer Support, but the answer is," it's not our business, it's an programming issue, have a nice day!"

    to be honest, I don't know what to say any more!

    Kind regards,

    Martin 

    Friday, February 2, 2018 8:41 AM
  • Hello Martin,

    Its not your fault, believe me, spend days looking into this issue. I used these package and it solved the problem.

    To install the prelease version use the source of https://dotnet.myget.org/F/dotnet-core/api/v3/index.json

    Friday, February 2, 2018 8:52 AM