2

I am having an urgent issue

Error exporting the site field named "HashTags"

when saving a site as a template. All fields are created in GUI, no code. I don't have a HashTag field in my site, that I know of. Any idea why this is happening?

It happens regardless of if site content is included or not. Also verified with SharePoint 2013 Manager that no Hashtag field exists - anywhere.

I have checked the ULS log and at first it appears to be related to Oslo template. Something that I haven't customized, and this is a subsite anyway.

I also noticed that there was another error regarding an entry with the same key that seemed suppressed here. Not sure if it's related, but same correllation id:

System.ArgumentException: An entry with the same key already exists.
at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value) at Microsoft.SharePoint.SPSolutionExporter.ExportFields(SPFieldCollection fields, String partitionName)

MDSLog: An error page was detected by MDS: Context Page MP (currentMPToken) = ['|CUSTOMERTEMPLATE:|_LAYOUTS|15|ERRORV15.MASTER:0.15.0.0.0.15.0.4420.1017.4.FALSE.:en-US:en-US:RW'], MP supplied by page in URL (originalMPToken) = ['|CUSTOMERTEMPLATE:|_CATALOGS|MASTERPAGE|OSLO.MASTER:3.15.0.0.0.15.0.4420.1017.4.FALSE.:en-US:en-US:RW'], Current Request URL = ['https://www.xxxxxxx.com/CustomerTemplate/_layouts/15/error.aspx?ErrorText=Error exporting the site field named "HashTags".&ErrorCorrelationId=d3665e9c-c301-007d-53ed-066f93ff2cc7&AjaxDelta=1']

2 Answers 2

1

looks like you have two fields within a list that are identical! keys i presume need to be unique!

An entry with the same key already exists

that refers to a duplicate entry: where?

ExportFields(SPFieldCollection fields, String partitionName)

within a field within a list!

whats the name of the field?

HashTags

unfortunatly it doesnt state which list appart from the exception type and field name! so what list i have no idea but atleast you now know that its because of a list on that site with an identical key and the culprit field is called HashTags

have you customised any list? by that i mean have you put a customisation on a list to become sorted?

EDIT

just created this code!

it might be slow in running but it works! create a console app, copy past code in and just change the SPSite url for it to look at the given site:

        using (SPSite mysite = new SPSite("http://YourSiteUrl"))
        {

            using (SPWeb web = mysite.OpenWeb())
            {

                SPListCollection collList = web.Lists;

                foreach (SPList list in collList)
                {
                    foreach (SPListItem item in list.Items)
                    {
                        foreach (SPField field in item.Fields)
                        {
                            if (field.TypeAsString == "HashTags")
                            {
                                var listlocal = list.DefaultDisplayFormUrl;
                                var listName = list.Title;
                                var fld = field.Title;

                                    Console.Out.Write("List Url =" + listlocal);
                                    Console.Out.Write("List name =" + listName);
                                    Console.Out.Write("Field name =" + fld);
                                    Console.Out.WriteLine();
                            }
                        }
                    }
                }
            }

        }

to understand what it refers to when it states keys: SortedList < TKey, TValue >.Add

You can only have one type of key (no duplicates) but you can have multiple duplicate values! : SortedList < TKey, TValue >.Keys

EDIT

forgot to add console.read!

   static void Main(string[] args)
    {

        using (SPSite mysite = new SPSite("http://yourTestSite"))
        {

            using (SPWeb web = mysite.OpenWeb())
            {

                SPListCollection collList = web.Lists;

                foreach (SPList list in collList)
                {
                    foreach (SPListItem item in list.Items)
                    {
                        foreach (SPField field in item.Fields)
                        {
                            if (field.TypeAsString != "HashTags")
                            {
                                var listlocal = list.DefaultDisplayFormUrl;
                                var listName = list.Title;
                                var fld = field.Title;

                                    Console.Out.Write("List Url =" + listlocal);
                                    Console.Out.Write("List name =" + listName);
                                    Console.Out.Write("Field name =" + fld);
                                    Console.Out.WriteLine();
                            }
                        }
                    }
                }
            }

        }
        Console.Read();
    }

EDIT

somthing is wrong with your sever to bring that error :s , but did find a solution to your origonal question tho!

the solution is from here.

Solution:

download sharepoint manager 2013.

goto parent site then look for Fields and deleted the HashTags field.

8
  • just ammended the answer! as we cant use the application due to major error I found a solution that should solve your issue!
    – Ali Jafer
    Commented Dec 9, 2013 at 13:57
  • You're so kind - I hate to tell you that I already did that (mentioned in my initial post). No hashtags found ... unless I'm missing something! I'm wondering if it's looking for the field and not finding it. I can't tell you enough how much I appreciate your help, though.
    – Josh
    Commented Dec 9, 2013 at 14:06
  • The only thing I'm doing 'unique' is that I have custom list forms. Otherwise, everything is standard ootb stuff (Content type, reusable workflows, etc.). I've been gradually adding pieces back in to a fresh subsite and trying to do the site template along the way.
    – Josh
    Commented Dec 9, 2013 at 14:08
  • lol that was the next thing i was going to say, could you make a fresh webapplication and a fresh subsite with nothing added in and make a template to see if it works! if it does then start to add things back in first oob then make a template and then lastly your custom list forms to see if its the culprit!
    – Ali Jafer
    Commented Dec 9, 2013 at 14:12
  • Probably not the whole web app - gotta get it done by tonight! Hoping that a fresh site will help ... more like praying. Nice to have someone to bounce ideas off of. Really appreciate it.
    – Josh
    Commented Dec 9, 2013 at 14:26

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.