Forum Discussion

Anthony Conrad's avatar
Anthony Conrad
Copper Contributor
Jan 16, 2018

PnP Provisioning Engine Extensibility Handlers: FileLoadException

I'm trying to use the PowerShell cmdlets and add my own extensibility handlers when using the Get-PnPProvisioningTemplate cmdlet.

 

I use the following PowerShell commands in the same directory as my custom class library:

 

$handler1 = New-PnPExtensbilityHandlerObject -Assembly MyProvider.dll -Type MyProvider.ListsProvider
Get-PnPProvisioningTemplate -Out .\test.xml -Force -Schema V201801 -ExensibilityHandlers $handler1 -Handlers ExtensibilityProviders

 

However, I keep getting the following error:

 

Get-PnPProvisioningTemplate : There was an exception invoking the custom extensibility provider. Assembly: MyProviders.dll, 
Type: MyProviders.ListsProvider. Exception System.IO.FileLoadException: Could not load file or assembly 'MyProviders.dll' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
File name: 'MyProviders.dll'
   at System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)
   at System.Reflection.RuntimeAssembly.CreateAssemblyName(String assemblyString, Boolean forIntrospection, RuntimeAssembly& assemblyFromResolveEvent)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName)
   at OfficeDevPnP.Core.Framework.Provisioning.Extensibility.ExtensibilityManager.GetProviderInstance(ExtensibilityHandler handler)
   at OfficeDevPnP.Core.Framework.Provisioning.Extensibility.ExtensibilityManager.ExecuteExtensibilityExtractionCallOut(ClientContext ctx, ExtensibilityHandler handler, ProvisioningTemplate template, 
ProvisioningTemplateCreationInformation creationInformation, PnPMonitoredScope scope)
At line:1 char:1

Can anybody help me understand the issue?

5 Replies

  • I think it is caused by the schema you are trying to use. i thought the 201801 would be available starting in februari. try 201705

    • Anthony Conrad's avatar
      Anthony Conrad
      Copper Contributor

      Really? hmm... I looked at their GitHub page and it shows 201801 as an approved version. That said, I'll try 201705 tomorrow when I get back into the job to make sure. I'll report back then.

      • Deleted's avatar
        Deleted

        Well as far as i know the schema is published but is not supported in the code yet

Resources