0

I tried to use Visual Studio 2012 to develop SharePoint 2010 solution on TFS 2012. I created the project on my Machine & added it to TFS, but when one of my team get latest version and check in the solution, anyone trying get latest version and open the package get the below error(Appear in Huge Message box):


--------------------------- Microsoft Visual Studio --------------------------- The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) Object reference not set to an instance of an object.

Resulting in: An exception occurred while calling the 'OnImportsSatisfied' method on type 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel'.

Resulting in: Cannot activate part 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel'.

Element: Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel --> Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel --> AssemblyCatalog (Assembly="Microsoft.VisualStudio.SharePoint.Designers.Package, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

Resulting in: Cannot get export 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.IPackageViewModel")' from part 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel'.

Element: Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.IPackageViewModel") --> Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.PackageViewModel --> AssemblyCatalog (Assembly="Microsoft.VisualStudio.SharePoint.Designers.Package, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

Resulting in: Cannot set import 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider.ViewModel (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.IPackageViewModel")' on part 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider'.

Element: Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider.ViewModel (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewModels.IPackageViewModel") --> Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider --> AssemblyCatalog (Assembly="Microsoft.VisualStudio.SharePoint.Designers.Package, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

Resulting in: Cannot get export 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.IViewProvider")' from part 'Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider'.

Element: Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider (ContractName="Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.IViewProvider") --> Microsoft.VisualStudio.SharePoint.Designers.Package.ViewProviders.PackageDesignViewProvider --> AssemblyCatalog (Assembly="Microsoft.VisualStudio.SharePoint.Designers.Package, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

Resulting in: An exception occurred while calling the 'OnImportsSatisfied' method on type 'Microsoft.VisualStudio.SharePoint.Designers.Package.Hosts.DslHost`1[[Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.Package, Microsoft.VisualStudio.SharePoint.Designers.Models.Packages, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]]'.

Resulting in: Cannot activate part 'Microsoft.VisualStudio.SharePoint.Designers.Package.Hosts.DslHost(Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.Package)'.

Element: Microsoft.VisualStudio.SharePoint.Designers.Package.Hosts.DslHost(Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.Package) --> Microsoft.VisualStudio.SharePoint.Designers.Package.Hosts.DslHost(Microsoft.VisualStudio.SharePoint.Designers.Models.Packages.Package)

--------------------------- OK

Package content :

<?xml version="1.0" encoding="utf-8"?>
<package xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="b6e3b6a2-438c-454c-9f38-c1a484c6b16b" solutionId="b6e3b6a2-438c-454c-9f38-c1a484c6b16b" resetWebServer="false" name="CurrentPoject Web Parts" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/PackageModel">
  <assemblies>
    <projectOutputAssembly location="CurrentPoject.SharePoint.Data.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\CurrentPoject.SharePoint.Data\MyCompany.CurrentPoject.SharePoint.Data.csproj" />
    <projectOutputAssembly location="MyCompany.CurrentPoject.SharePoint.Common.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\CurrentPoject.SharePoint.Common\MyCompany.CurrentPoject.SharePoint.Common.csproj" />
    <customAssembly location="AspNetPager.dll" deploymentTarget="GlobalAssemblyCache" sourcePath="DLLs\AspNetPager.dll" />
    <customAssembly location="MyCompany.SharePoint.Calendar.dll" deploymentTarget="GlobalAssemblyCache" sourcePath="DLLs\MyCompany.SharePoint.Calendar.dll" />
    <projectOutputAssembly location="MyCompany.SharePoint.ExceptionHandlers.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\MyCompany.SharePoint.ExceptionHandlers\MyCompany.SharePoint.ExceptionHandlers.csproj" />
    <projectOutputAssembly location="MyCompany.SharePoint.ActiveDirectory.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\MyCompany.SharePoint.ActiveDirectory\MyCompany.SharePoint.ActiveDirectory.csproj" />
  </assemblies>
  <features>
    <featureReference itemId="2eb6a71d-24e3-401f-9a22-bdeffa77a94c" />
    <featureReference itemId="26fb536a-d63e-4a51-a978-70b90acbc99a" />
    <featureReference itemId="0b0c7082-c136-493f-bd7a-f5405a17359e" />
    <featureReference itemId="20709c72-968d-440c-9320-8a1ab165fc7a" />
    <featureReference itemId="31cd8661-a010-4a77-a069-6eb0dcea98ae" />
    <featureReference itemId="129ed040-7cb7-43de-bdee-dd2ecb801f2d" />
    <featureReference itemId="3ae5f399-3483-4bec-a64e-d707b2daecb6" />
    <featureReference itemId="b8f51282-4167-43ba-aa8e-edb01ec0e3e8" />
    <featureReference itemId="015c259c-faa8-49da-87db-59c264036d1a" />
    <featureReference itemId="fc1eb4cf-1097-4078-a6f3-afbb1c105102" />
    <featureReference itemId="6213f766-124b-4a39-b401-2aa616066d58" />
    <featureReference itemId="d42aeeb1-fd79-4a80-bc18-6eb6c233ffc3" />
    <featureReference itemId="c1d100b6-c80d-4c9e-9dae-1592e3f0deb1" />
    <featureReference itemId="a3104cc3-1c87-468a-a6ba-0eca6a661b5b" />
    <featureReference itemId="a72e41ea-dde5-4485-a550-b5670efddfa8" />
    <featureReference itemId="c7f291ab-d02e-4b66-9228-4816b3e27f2c" />
    <featureReference itemId="484c1979-e710-4a5b-8ea6-a1692eb64a53" />
    <featureReference itemId="f8f794fd-483e-4753-a413-cf4dacce8899" />
    <featureReference itemId="f74b957b-5909-448e-b433-f69c7798d30b" />
    <featureReference itemId="3ccdb81f-a9f7-4853-b179-5d9098653e99" />
    <featureReference itemId="f27b80ea-51cc-45d7-aadc-d92d05a9f3e3" />
    <featureReference itemId="1d75c752-06b3-4877-96cd-e3f9115203dd" />
    <featureReference itemId="09776a1c-5252-4ec1-8b99-6eb0692b2dca" />
    <featureReference itemId="a36ba92f-829b-4adf-b3ad-ab70f8d63848" />
    <featureReference itemId="10527ea8-9fb3-48b1-aec2-770f1775f901" />
    <featureReference itemId="23b34d26-ca2d-45bb-abc6-26ca4b455fe4" />
    <featureReference itemId="fa28ae95-c2bf-4e8d-be60-fcabadb2d220" />
    <featureReference itemId="d8b5a51c-7284-4a21-90f3-7417641d020d" />
    <featureReference itemId="625c5287-1c84-41fc-a638-0371c098c2e9" />
    <featureReference itemId="b1ba9635-6198-48be-8632-3e6352bd3270" />
    <featureReference itemId="c2f10d98-ef93-4e6f-ae9b-506102350480" />
    <featureReference itemId="fa487f9a-9e27-4ca0-87c1-9cc0a55e0f40" />
    <featureReference itemId="6a075675-c0a4-4dd8-aa94-a1bbc2c0b414" projectPath="..\MyCompany.CurrentPoject.CustomAction\MyCompany.CurrentPoject.CustomAction.csproj" />
    <featureReference itemId="3b4e6ecf-e8c6-4243-a119-6f0559389e04" />
    <featureReference itemId="3c87aaa3-2a20-4a6d-8523-45fce00c0813" />
    <featureReference itemId="5e05a17f-e9ca-47d5-a1ed-681bae00ded5" />
    <featureReference itemId="04246425-3fec-464d-99f7-463a9e704761" />
    <featureReference itemId="49de3a8c-dad5-432b-b2ea-f4183646902e" />
    <featureReference itemId="09691255-b566-4025-9539-74ab9331cf18" />
    <featureReference itemId="83bbe070-b651-4041-8473-b0dc1a9ce610" />
    <featureReference itemId="e0aa9db5-4047-4327-85a8-45a9c696a872" />
    <featureReference itemId="e9d61d37-fc54-4684-851a-3f0578e56ca8" />
    <featureReference itemId="64899a89-89c8-43c3-b0ff-d6a89e086d65" projectPath="..\MyCompany.CurrentPoject.Lists\MyCompany.CurrentPoject.Lists.csproj" />
    <featureReference itemId="6e298e22-657c-4f49-b538-ae7c32788391" />
    <featureReference itemId="d5c4fa7b-f967-41da-b3c0-39ace73f56f4" />
    <featureReference itemId="d4db8b79-6d06-480f-bc7b-27ff969e551d" />
    <featureReference itemId="17c2e976-8dc9-446a-b17a-cd21b253ecb3" />
  </features>
  <projectItems>
    <projectItemReference itemId="14393c6c-e6e4-4edf-ae6c-dac445d1cad3" />
  </projectItems>
</package>

enter image description here

1

I got it , this error coming when visual studio try to get assemblies from GAC related to SharePoint package designer, Just Install "Office Developer Tool for visual studio" via Microsoft web platform installer or visual studio, it will work

Thanks

0

That usually happens because you have references inside the package that doesn't exist or could not be found. Inside a package there are commonly feature references and project item references. What you have to do so that it works properly is to edit the Package.package file with a Text Editor and remove the references.

This is an example of my Package.package file

<?xml version="1.0" encoding="utf-8"?>
<package xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="1.0.0.0" Id="402f4edd-1693-4923-b869-4eb954a5a920" solutionId="402f4edd-1693-4923-b869-4eb954a5a920" resetWebServer="false" sharePointProductVersion="15.0" name="Intranet.Master" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/PackageModel">
  <assemblies>
    <projectOutputAssembly location="MyUtils.dll" deploymentTarget="GlobalAssemblyCache" projectPath="..\Intranet.Utils\Intranet.Utils.csproj">
      <safeControls>
        <safeControl assemblyName="Intranet.Utils" namespaceName="Intranet.Utils" typeName="*" isSafeAgainstScript="false" />
      </safeControls>
    </projectOutputAssembly>
  </assemblies>
  <features>
    <featureReference itemId="9cbc5507-b9ac-4caa-baff-11cfc0802348" />
    <featureReference itemId="80cad20e-a960-4716-8d81-3b244806d2c9" />
    <featureReference itemId="8769d353-f16b-495b-a8cc-62ad75138d2d" />
    <featureReference itemId="e348496d-d0b8-4785-a111-dd8d52d28a08" />
  </features>
  <projectItems>
    <projectItemReference itemId="0c0d8117-d8fc-4990-8839-ecc7da6bb7fb" />
    <projectItemReference itemId="6b71af7f-28e9-420b-8744-75c37c78ae43" />
  </projectItems>
</package>

You would have to delete de featureReference and projectItemReference nodes and add the items to the package again manually.

  • How i can delete these feature references, you mean open it in notepad then delete,build & read them again???? – Sherif Oct 4 '13 at 11:24
  • that is. Modify the Package with a notepad but only deleting featureReference and projectItemReference nodes. Make a backup first of your files. After opening again Visual Studio you shouldn't get the Object Reference.... error – Alvmad Oct 4 '13 at 11:51
  • after i follow your steps, still the same error?? – Sherif Oct 4 '13 at 13:26
  • What happens if you doubleclick your Package icon within Visual Studio? Are you getting the same error? Can you post your current package content? – Alvmad Oct 4 '13 at 15:09
  • yes i get the same error when i tried to double click on Package icon. I added package content. – Sherif Oct 4 '13 at 19:34
0

I had this happen to me. Luckily I had a backup of my project from before so by comparing I was able to figure out what happened. I double clicked on my project (created in VS 2013 update 4) and it opened in VS 2012 which triggered the update wizard. To make a long story short, VS 2012 updated my csproj file to add a subtype on a feature. Once I removed that everything worked again.

From the csproj (the <SubType>Designer</SubType> needs to be removed to fix the error):

<Content Include="Features\Document Feature\Document Feature.Template.xml">
  <DependentUpon>Document Feature.feature</DependentUpon>
  <SubType>Designer</SubType>
</Content>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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