question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modernization AddOn

See original GitHub issue

Does the Modernization support AddOn when running from Pnp.Powershell? I am getting below error message when trying. Might be that I’m doing something wrong?

_Constructor on type 'Contoso.Modernization.MyCustomFunctions' not found.   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at PnP.Framework.Modernization.Functions.FunctionProcessor..ctor(ClientContext sourceClientContext, ClientContext targetClientContext, IPage page, PageTransformation pageTransformation, BaseTransformationInformation baseTransformationInformation, IList`1 logObservers)
   at PnP.Framework.Modernization.Transform.ContentTransformator..ctor(ClientContext sourceClientContext, ClientContext targetClientContext, IPage page, PageTransformation pageTransformation, BaseTransformationInformation transformationInformation, IList`1 logObservers)
   at PnP.Framework.Modernization.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)_

Reproduction steps I’m following the steps described here

Create class. (I have tried .NET Core 3.1 / .NET Framework 4.6.1 / .NET 5.0, but no difference) Note that the instruction in the link above is using SharePointPnP.Modernization.Framework.Functions, but when using the new version it should be PnP.Framework.Modernization.Functions?

using Microsoft.SharePoint.Client;
using PnP.Framework.Modernization.Functions;
using System;

namespace Contoso.Modernization
{
    public class MyCustomFunctions : FunctionsBase
    {
        public MyCustomFunctions(ClientContext clientContext) : base(clientContext)
        {
        }

        public string MyListAddServerRelativeUrl()
        {
            return "SomeString";
        }

    }
}

Then I add this to the webpartmapping.xml (Issue comes directly when adding this to the mapping file, so in the example here I haven’t started to use it in the actual mapping)

<AddOn Name="Custom" Type="Contoso.Modernization.MyCustomFunctions" Assembly="C:\ClassLibrary1\bin\Debug\net461\ClassLibrary1.dll" />

Then call migration using

ConvertTo-PnPPage -ClearCache -Identity testmigration.aspx -TargetPageName TestMigration.aspx -PublishingPage -Overwrite -TargetConnection $global:target -Connection $global:source -WebPartMappingFile ($PSScriptRoot + "\PageLayoutMappings\webpartmapping.xml") -SkipItemLevelPermissionCopyToClientSidePage -SetAuthorInPageHeader -KeepPageCreationModificationInformation -LogType File -LogVerbose -LogFolder ($PSScriptRoot + "\Logs");

I am using PnP.Powershell v. 1.5.0 and PnP.Framework v.1.4.0 Conversion from SP2016 publishing pages to SP online Modern Pages

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FredrikEkstroemcommented, May 8, 2021

Sorry, did not have time to try, hope next week looks better. The use case was to identify some more special cases of cewp usages like iframes, specific js code that should be mapped to custom web parts etc. Thanks for following up

On 8 May 2021, at 10:55, Bert Jansen @.***> wrote:

@FredrikEkstroem : did you manage to get your extension working?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

0reactions
webdevelperifycommented, Feb 19, 2022

Is there any update over this. My use case is disabling all the content logic extraction from Content Editor Webpart and directly map to React Modern Script webpart. Can I achieve this using AddOn model?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding and configuring the page transformation ...
SharePoint PnP Modernization is part of the PnP Framework and is ... and selectors...simply defining them in the AddOn section and then ...
Read more >
Application Modernization Strategy Services
Our goal for an application modernization project is to create new business value from existing apps and gain more alertness, mitigate risk and...
Read more >
Firefox add-on technology is modernizing
Firefox add-on technology is modernizing. Add-ons allow you to add extra features and functionality to Firefox, modify the Firefox user interface and change ......
Read more >
Cloud Application Modernization
Modernize your existing apps, build new ones, and run them anywhere with Google Cloud's application modernization solutions.
Read more >
Modernization War 2023 / Israel Addon V1. 5 file
Modernization War 2023 · Battlefield 2 mod | Released May 24, 2023. summary · articles · reviews · files · videos · images....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found