Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

Uncategorized

Event Error 5553 – failure trying to synch site”??” for ContentDB “??” WebApp “??”. Exception message was Cannot insert duplicate key row in object ‘dbo.UserMemberships’ with unique index

I ran into this problem this week after doing several site collection moves.     The resolution is simple, effective, and only take a few minutes.

ststam -o preparetomove –contentdb [SQLServer:DatabaseName] –site http://sharepoint
stsadm -o deletecontentdb –url http://sharepoint –databasename [database] –databaseserver [SQLSever]
stsadm -o addcontentdb –url http://sharepoint –databasename [database] –databaseserver [SQLSever]

SharePoint 2010 Beta coming in July?

It looks like we’ll have a new release this Summer to learn.    http://www.networkworld.com/news/2009/051509-microsoft-sharepoint.html

http://www.blogsdna.com/wp-content/uploads/2009/04/microsoft-office-2010-about.png
  • Rizzo stressed during his presentation at TechEd that users will have to start thinking 64-bit when they think of the next version of SharePoint.
  • The 2010 edition will require a 64-bit version of SQL Server 2005 or 2008. In addition, the server will run on the 64-bit version of Windows Server 2008.
  • Rizzo also announced that SharePoint Server 2010 will not support Internet Explorer 6.

Coding EventLog Excellence

Summary

It’s a best practice to have all custom code write to the event log.   Every code execution should produce one and only one log entry.   Exceptions (code speak for err) should be written here.    For troubleshooting and support you can’t ask for a better tool.    The framework exists, EventCombMT helps aggregate, and it allows you to run dozens … or hundreds … of apps while keeping a sharp eye on quality control.

Namespaces

System.Diagnostics.EventLog

Example

clip_image002

 

static void Main(string[] args)
{
    try {
        //Main code procedure
        Console.WriteLine("Hello World!");
        writeEventlog(1, null);         //Write to Eventlog – GOOD 
    }
    catch (System.Exception e)
    {
        writeEventlog(2, e);            //Write to Eventlog – BAD
    }
}
static void writeEventlog(int success, System.Exception e)
{
    //Current EXE name
    String exe = System.Reflection.Assembly.GetExecutingAssembly().FullName.Split(‘,’)[0];
    String header = "";
    String exception = "";
    EventLogEntryType type = EventLogEntryType.Information;
   
    //Determine type
    switch (success)
    {
        case 1:
            header = "nOperation successfully completed";
            break;
        case 2:
            header = "nOperation FAILED";
            if (e != null) strException = e.Message + e.InnerException + e.StackTrace;
            type = EventLogEntryType.Error;
            break;
        case 3:
            header = "nOperation WARNED";
            if (e != null) exception = e.Message + e.InnerException + e.StackTrace;
            type = EventLogEntryType.Warning;
            break;
    }
 
    //Write to log
    EventLog myLog = new EventLog("Application", ".", exe);
    myLog.WriteEntry(exe + "n" + exception, type);
}

The given key was not present in the dictionary.

If you see this error message in WSS chances are you have an active reference to custom field type but have not installed the field type.     The “/_layouts/mngfield.aspx” page will throw this error in the above scenario.    Two possible resolutions:

 

 

  • Remove the Site Column (SPField) objects with object model code.     Requires developer skills.

 

image

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲