Skip to content

Get IPnPContextFactory for class library #826

Answered by wonderplayer
wonderplayer asked this question in Q&A
Discussion options

You must be logged in to vote

Never mind, I was really close to the answer myself :D
It's not the best, but if anyone is interested, here is how I got it:

    [TestClass]
    internal static class AssemblyInitialize
    {
        public static ServiceProvider ServiceProvider { get; private set; }
        [AssemblyInitialize()]
        public static void StartUp(TestContext context)
        {
            ApplicationSettings applicationSettings = TestCommon.GetAllSettings();

            var serviceProvider = new ServiceCollection()
                    .AddPnPContextFactory(options =>
                    {
                        var authProvider = new X509CertificateAuthenticationProvider(
                            a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wonderplayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant