Daily Usage Issues

Package error

Started by kentcb on 5,250 views

Hi,

Having installed 3.12.0.15, NCrunch no longer works. VS shows this message upon startup:

---------------------------
Microsoft Visual Studio
---------------------------
The 'nCrunch.VSIntegration2010.CrunchPackage, nCrunch.VSIntegration2017, Version=3.11.0.9, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea' package did not load correctly.



The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\Kent\AppData\Roaming\Microsoft\VisualStudio\15.0_c778db96\ActivityLog.xml'.



Restarting Visual Studio could help resolve this issue.



Continue to show this error message?
---------------------------
Yes No
---------------------------


Inside the specified file I found:

  <entry>
    <record>763</record>
    <time>2017/11/29 02:53:09.686</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [nCrunch.VSIntegration2010.CrunchPackage, nCrunch.VSIntegration2017, Version=3.11.0.9, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea]</description>
    <guid>{14D2CAB3-EE7F-496E-BF5D-C67D2CBDD84D}</guid>
  </entry>
  <entry>
    <record>764</record>
    <time>2017/11/29 02:53:09.690</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [nCrunch.VSIntegration2010.CrunchPackage, nCrunch.VSIntegration2017, Version=3.11.0.9, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2017\nCrunch.VSIntegration2017.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;System.IO.FileNotFoundException: Could not load file or assembly &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2017\nCrunch.VSIntegration2017.dll&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2017\nCrunch.VSIntegration2017.dll&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)&#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)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
    <guid>{14D2CAB3-EE7F-496E-BF5D-C67D2CBDD84D}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>

I've tried:

* uninstalling and installing the version that previously worked for me. Now it gives me the same error.
* restarting my machine
* clearing the component cache

None of these has resolved the error. Even with NCrunch uninstalled, VS still throws up the error during startup :/
Fun fact: this is the first time I've updated NCrunch since installing VS Preview side-by-side with VS. I'm almost certain that will be the underlying cause, but shouldn't it just work?

UPDATE: indeed, if I instead start VS Preview, NCrunch is installed there. It's failing to work for a completely unrelated reason though (https://github.com/dotnet/roslyn-analyzers/issues/1331) so I can't even just use preview for now :(

Edited

Hi,

This is a VS install state issue. For some reason, VS hasn't refreshed it's extension cache after the MSI was run. To fix this, run 'devenv.exe /setup' as an administrator and wait for this to finish processing in the background.
That stopped my stable VS from complaining about the extension, but re-installing NCrunch has not installed it into VS - only into VS Preview. How do I "target" the install to VS instead of VS Preview?
I installed manually and it's working for now. Still, would be good to know why this was required.
kentcb wrote:I installed manually and it's working for now. Still, would be good to know why this was required.


As far as I know, it's a bug in VS.

When NCrunch installs, it makes a change to the C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\extensions.configurationchanged file, which should technically signal to the IDE that the extension cache is invalid and that it needs to be reloaded.

You're the second user that's reported this problem in upgrading to v3.12, so I suspect that something has recently either changed or gone wrong in VS2017 that causes this to intermittently fail.

The "devenv.exe /setup" step forces VS to throw away all its internal caches and rebuild them from scratch. Originally NCrunch did this as part of its install step (for VS2008 it still does). However, there are risks involved in doing this. The process Visual Studio uses to rebuild its package cache is not 100% reliable and occasionally problems come up. Some of these problems are big enough to require a reinstallation of the IDE.

There is no way to avoid these problems. It is the unfortunate reality of needing to load an extension into a massive and extremely complex IDE with a very long development history.

Regarding the need to install manually, this is because you have two different instances of VS installed. Windows Installer cannot handle dynamic installation to multiple install paths, so the MSI will choose one more or less at random. Manual installation is currently a requirement if you have multiple VS instances. We're looking at ways to resolve this, but right now just even keeping the product working with the relentless churn from MS is proving to be extremely challenging.
Understood, and I know exactly what you mean about churn. I've just about had enough myself. Thanks Remco.

Post a reply

Log in to reply.