Azure Functions: [A]PnPManifest cannot be cast to [B]PnPManifest
Open
@jansenbe is already working on this.
Since Jan 13, 2021.
area: provisioning ⚙
bug
Stale
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
I load my PnP Template from a .pnp file, and this works without a problem when executing locally. If I deploy my Azure Function, I get the following error:
[Error] Error Message: [A]PnP.Framework.Provisioning.Connectors.OpenXML.Model.PnPManifest cannot be cast to [B]PnP.Framework.Provisioning.Connectors.OpenXML.Model.PnPManifest. Type A originates from 'PnP.Framework, Version=0.1.109.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\home\site\wwwroot\bin\PnP.Framework.dll'. Type B originates from 'PnP.Framework, Version=0.1.109.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\home\site\wwwroot\bin\PnP.Framework.dll'.
[Error] Error while processing dossier: [A]PnP.Framework.Provisioning.Connectors.OpenXML.Model.PnPManifest cannot be cast to [B]PnP.Framework.Provisioning.Connectors.OpenXML.Model.PnPManifest. Type A originates from 'PnP.Framework, Version=0.1.109.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\home\site\wwwroot\bin\PnP.Framework.dll'. Type B originates from 'PnP.Framework, Version=0.1.109.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\home\site\wwwroot\bin\PnP.Framework.dll'.
at PnP.Framework.Provisioning.Connectors.OpenXML.PnPPackage.GetXamlSerializedPackagePartValue[T](PackagePart part)
at PnP.Framework.Provisioning.Connectors.OpenXML.PnPPackage.get_Manifest()
at PnP.Framework.Provisioning.Connectors.OpenXML.PnPPackageExtensions.LoadPnPPackage(PnPPackage package)
at PnP.Framework.Provisioning.Connectors.OpenXML.PnPPackageExtensions.UnpackTemplate(MemoryStream stream)
at PnP.Framework.Provisioning.Connectors.OpenXMLConnector..ctor(String packageFileName, FileConnectorBase persistenceConnector, String author, X509Certificate2 signingCertificate, String templateFileName)
at ...
If I switch my code to run from .xml, it works in Azure Functions. Problem seems to happen in this method, but I don't see why. There are two casts happening...
https://github.com/pnp/pnpframework/blob/6b7b45166cf4fd17412fe3dff9ef14a6a1def35d/src/lib/PnP.Framework/Provisioning/Connectors/OpenXML/PnPPackage.cs#L315-L350
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.