I have a problem with a custom action in SharePoint 2019 on premise. The custom action adds a link in the menu item of the SharePoint menu bar. It's a mysite collection.

SharePoint 2013 (it works): https://ibb.co/PxM0wzP

In SharePoint 2019 theres no link (site collection feature is deployed) see here: https://ibb.co/bRtkQXw

The crazy thing is that's not visible on the Person.aspx. On the default.aspx it's added: https://ibb.co/XW2qh4h

It's working fine on the old 2013 on premise SharePoint. I have no idea why it's not added to the person.aspx

Here's the code for the custom action class:

public class EditProfileCustomLink : SPSecurityTrimmedControl
   protected MenuItemTemplate menuItem;
   protected override void CreateChildControls()

      SPUser currentuser = SPContext.Current.Web.CurrentUser;
      SPWebApplication webApplication = SPContext.Current.Site.WebApplication;

      if (currentuser != null && webApplication != null && webApplication.UserSettingsProvider != null )
                // Get the assigned settings provide
                SPUserSettingsProvider usp = webApplication.UserSettingsProvider;

                // Get the source url
                string sourceUrl = SPContext.Current.Site.MakeFullUrl(HttpContext.Current.Request.RawUrl.ToString());
                sourceUrl = SPHttpUtility.HtmlEncode(DeltaPage.RemoveDeltaQueryParameters(sourceUrl));

                string editProfileUrls = string.Format("~site/_layouts/15/EditProfile.aspx?UserSettingsProvider={0}&ReturnUrl={1}", Uri.EscapeDataString(usp.ProviderIdentifier.ToString()), sourceUrl);

                // Initialize the menu item
                this.menuItem = new MenuItemTemplate();
                this.menuItem.Title = SPUtility.GetLocalizedString("$Resources:EditProfile", Constants.ResourceFile, (uint)CultureInfo.CurrentUICulture.LCID);
                this.menuItem.Text = SPUtility.GetLocalizedString("$Resources:EditProfile", Constants.ResourceFile, (uint)CultureInfo.CurrentUICulture.LCID);
                this.menuItem.Description = SPUtility.GetLocalizedString("$Resources:EditProfile", Constants.ResourceFile, (uint)CultureInfo.CurrentUICulture.LCID);
                this.menuItem.Sequence = 1040;
                this.menuItem.Visible = true;
                this.menuItem.ClientOnClickNavigateUrl = editProfileUrls;

                // Add custom menu item
            catch (Exception ex)
                 Logger.Instance.LogError(LogCategory.Web, String.Format("Error while creating edit profile link '{0}'", ex));        

The elements.xml:


1 Answer 1


You need to rebuild your application to correct DLL version for SharePoint 2019. Next is that I see in code you have bad url:

 string editProfileUrls = string.Format("~site/_layouts/15/EditProfile.aspx?UserSettingsProvider={0}&ReturnUrl={1}", Uri.EscapeDataString(usp.ProviderIdentifier.ToString()), sourceUrl);

You need to use /_layouts/16/ for SP2016 and SP2019.

There are changes between SP2013 and newer Versions, make sure your application is compatible.

  • Thx for your quick response. I have updated all referenced SharePoint Dlls to and changed the path to ~site/_layouts/16/EditProfile.aspx?UserSettingsProvider={0}&ReturnUrl={1}. But behaviour is the same. On default.aspx my custom action works and I see the edit profile link in the menu bar, but not on the persons.aspx.
    – Sandro
    Commented Jan 31, 2019 at 10:45
  • there can be also some different definitions in MaterPage, cause for SP16 and SP19 its like "OneDrive" not Mysite Commented Jan 31, 2019 at 10:51
  • MaterPage should be the same for Person.aspx or Default.aspx. I dont understand the behaviour, because it's the same site collection???
    – Sandro
    Commented Jan 31, 2019 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.