none
The 'ApacheCordovaToolsPackage' package did not load correctly and more errors RRS feed

  • Question

  • I cannot work with Cordova Tools for Visual Studio anymore. I am getting the following error on opening a Cordova project: 'The 'ApacheCordovaToolsPackage' package dit not load correctly.'.

    I have already tried the solutions suggested at StackOverflow, you can find my original post at: http://stackoverflow.com/questions/41654192/the-apachecordovatoolspackage-package-did-not-load-correctly-and-more-errors

    To sum-up what I have already tried:
    • Create a new, clean Cordova project;
    • Delete the .vs folder in the Cordova project's folder;
    • Install ALL the Visual Studio project types;
    • Run Visual Studio as Administrator;
    • Removing Visual Studio (and a clean Visual Studio install afterwards);
    • Removing Cordova Tools (via Add/Remove) and reinstalling;
    • Clearing the cache, located at: 'C:\Users[username]\appdata\local\microsoft\VisualStudio\14.0\ComponentModelCache';
    • Execute the installer with the options '/modify /installselectableitems Javascript';

    I think it has something to do with a wrong path definition, as the error logged in the ActivityLog.xml, specifies.

    Error #1:

    <entry>
        <record>714</record>
        <time>2017/01/15 18:09:04.318</time>
        <type>Error</type>
        <source>VisualStudio</source>
        <description>LegacySitePackage failed for package [ApacheCordovaToolsPackage]Source: &apos;mscorlib&apos; Description: Could not find a part of the path &apos;C:\Users\andre\AppData\Local\Microsoft\Windows\INetCookies\Low&apos;.&#x000D;&#x000A;System.IO.DirectoryNotFoundException: Could not find a part of the path &apos;C:\Users\andre\AppData\Local\Microsoft\Windows\INetCookies\Low&apos;.&#x000D;&#x000A;   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)&#x000D;&#x000A;   at System.IO.FileSystemEnumerableIterator`1.CommonInit()&#x000D;&#x000A;   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)&#x000D;&#x000A;   at System.IO.Directory.GetFiles(String path, String searchPattern)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.Telemetry.Cookies.CookieReader.GetCookiesFromFolders(List`1 paths, String browser)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.Telemetry.Cookies.CookieReader.GetCookies()&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.Telemetry.Reporting.solutionListener_ProjectOpened(Object sender, ProjectEventArgs e)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.Telemetry.Reporting.SendMissedProjectOpenEvents()&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.Telemetry.Reporting..ctor(IServiceProvider serviceProvider, SolutionEventsListener solutionListener)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.Telemetry.Reporting.Initialize(IServiceProvider serviceProvider)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage.Initialize()&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)</description>
        <guid>{317A330D-8757-4084-8526-E8A1D165433D}</guid>
        <hr>80070003</hr>
        <errorinfo></errorinfo>
      </entry>

    Error #2:

    <entry>
    <record>512</record>
    <time>2017/01/14 19:29:06.740</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [ApacheCordovaToolsPackage]Source: &apos;mscorlib&apos; Description: Exception has been thrown by the target of an invocation.&#x000D;&#x000A;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage.configurationServiceProvider (ContractName=&quot;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&quot;)&apos; on part &apos;Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage.configurationServiceProvider (ContractName=&quot;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&quot;) --&gt;  Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage&#x000D;&#x000A;&#x000D;&#x000A;   at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.NetFxAdapters.CompositionService.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage..ctor()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandleInternal&amp; ctor, Boolean&amp; bNeedSecurityCheck)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Activator.CreateInstance(Type type, Boolean nonPublic)&#x000D;&#x000A;   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.&#x000D;&#x000A;&#x000D;&#x000A;1) No exports were found that match the constraint: &#x000A;&#x0009;ContractName&#x0009;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&#x000A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import &apos;Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage.configurationServiceProvider (ContractName=&quot;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&quot;)&apos; on part &apos;Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage.configurationServiceProvider (ContractName=&quot;Microsoft.VisualStudio.MultiDeviceHybridApps.Definitions.ICordovaAppConfigurationServiceProvider&quot;) --&gt;  Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage&#x000D;&#x000A;&#x000D;&#x000A;   at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.NetFxAdapters.CompositionService.SatisfyImportsOnce(ComposablePart part)&#x000D;&#x000A;   at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)&#x000D;&#x000A;   at Microsoft.VisualStudio.MultiDeviceHybridApps.VSPackages.ApacheCordovaToolsPackage..ctor()</description>
    <guid>{317A330D-8757-4084-8526-E8A1D165433D}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>

    Can anyone help me out?

    Some extra information:

    • Windows 10
    • Visual Studio 2015 Enterprise




    • Edited by DaGrooveNL Monday, January 16, 2017 6:30 PM
    Sunday, January 15, 2017 3:19 PM

Answers

  • I got contacted by the team responsible for the Cordova Tools.

    Apparently, the following folder was missing on my system: C:\Users\[username]\AppData\Local\Microsoft\Windows\INetCookies\Low

    By starting Internet Explorer, the missing folders got recreated and subsequently, I did not receive any errors anymore. My problem is now solved.

    • Marked as answer by DaGrooveNL Sunday, January 22, 2017 8:45 PM
    Sunday, January 22, 2017 8:45 PM

All replies

  • Hi,

      Could you please try run VS as Administrator?

    Best Regards,

    Elvis Xia

    Monday, January 16, 2017 8:53 AM
  • I already did, I forgot to put it in the sum-up of things I already tried. It does not solve my issue.
    Monday, January 16, 2017 6:29 PM
  • I got contacted by the team responsible for the Cordova Tools.

    Apparently, the following folder was missing on my system: C:\Users\[username]\AppData\Local\Microsoft\Windows\INetCookies\Low

    By starting Internet Explorer, the missing folders got recreated and subsequently, I did not receive any errors anymore. My problem is now solved.

    • Marked as answer by DaGrooveNL Sunday, January 22, 2017 8:45 PM
    Sunday, January 22, 2017 8:45 PM