Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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)

share|improve this question
    
have you restarted the Visual studio and try adding the web part again? Could you please add more details? –  Falak Mahmood Nov 11 '12 at 10:05
add comment

1 Answer

up vote 0 down vote accepted

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.

http://social.technet.microsoft.com/Forums/en-US/winservermanager/thread/f80a52fc-b022-4dd4-af35-621f1e7fe67c/

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 :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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