I get the following error when trying to add a web part to a sandboxed solution in visual studio.

It works fine if i add the webpart via sharepoint designer

Any ideas anyone?

[COMException: An identity contains two definitions for the same attribute. (Exception from HRESULT: 0x8007370C)] at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName) at Microsoft.SharePoint.WebPartPages.WebPartImporter.GetTypeForObjectModel(Assembly assembly, String typeName) at Microsoft.SharePoint.WebPartPages.WebPartImporter.CreateWebPart(Boolean clearConnections) at Microsoft.SharePoint.WebPartPages.WebPartImporter.Import(SPWebPartManager manager, XmlReader reader, Boolean clearConnections, Uri webPartPageUri, SPWeb spWeb) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CompressWebPartNoSave(Boolean isClosed)

  • have you restarted the Visual studio and try adding the web part again? Could you please add more details? Nov 11, 2012 at 10:05

1 Answer 1


can you try the following?

  1. on windows click START and select RUN and type the following: Dcomcnfg.exe

when it loads choose the following:

  1. Choose ComponentServices->Computers->My Computer.

  2. Right click My Computer and Choose Properties from the context menu.

  3. Choose the Default Properties tab.

  4. Select Connect in the Default Authentication Level drop down list if it is set to None. Choose OK, confirm selection in popup and close dcomcnfg.exe.

  5. If the authentication level is not set to None, don’t change it, since it may have been set by something else (such as an Admin).

  6. While at it, it is better to change the Default Impersonation Level to Identify, if it is set to something else. As mentioned, a setting greater than Identify lowers the COM security on the box.

These settings may have the effect of breaking the app you installed. If it does, then it is a bug in the app. An app must not require changes to the machine-wide COM security configuration. You may want to contact the vendor of the app.


So for my settings its set to "Connect" for Default authentication level and "Identity" for Default impersonation level.

The above is talking about an app that could of changed your settings for some reason or another what has broken the com settings for sharepoint. Check to make sure your settings are set properly :)

Hope it helps :)

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.