madskristensen / NpmTaskRunner

Visual Studio extension
Other
88 stars 32 forks source link

Task Runner Explorer no longer works after upgrade to VS2022 version 17.4.0 #87

Open robbaman opened 1 year ago

robbaman commented 1 year ago

Describe the bug After the upgrade to VS2022 version 17.4.0 the Task Runner explorer no longer works.

To Reproduce Steps to reproduce the behavior:

  1. Have Task Runner working in VS2022 version 17.3.x
  2. Upgrade VS to 17.4.0
  3. Start VS and open the Task Runner Explorer

Instead of the regular content of the window an exception is shown.

Additional context

An exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\mulde\AppData\Roaming\Microsoft\VisualStudio\17.0_618a8769\ActivityLog.xml".

Exception details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "Microsoft.WebTools.TaskRunnerExplorer.TaskRunner.TaskRepository.Workspace.WorkspaceTaskRepository". ---> Microsoft.VisualStudio.ExtensibilityHosting.InvalidMEFCacheException: The Visual Studio component cache is out of date (assembly: NpmTaskRunner, Version=1.4.96.0, Culture=neutral, PublicKeyToken=null). Please restart Visual Studio.
   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.<LoadAssembly>b__17_0(AssemblyName assemblyNameParam)
   at Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory)
   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)
   at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.GetManifest(Resolver resolver, AssemblyName assemblyName)
   at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.TryUseFastReflection(TypeRef typeRef, Module& manifest)
   at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(MethodRef methodRef)
   at Microsoft.VisualStudio.Composition.Reflection.MemberRef.get_MemberInfo()
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass63_0.<CreateExport>b__0()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass52_3.<GetExports>b__5()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.<>c__DisplayClass10_0.<UnwrapExport>b__1()
   at System.ComponentModel.Composition.Primitives.Export.get_Value()
   at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.WebTools.TaskRunnerExplorer.TaskRunnerManager.<CreateTaskRunnerConfigAsync>d__127.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.ConstructExportedValue(RuntimeImport import, RuntimeExport export, RuntimePartLifecycleTracker importingPartTracker, PartLifecycleTracker partLifecycle, ReportFaultCallback faultCallback)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass16_0.<GetExportedValue>b__1()
   at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.WebTools.TaskRunnerExplorer.TaskRunner.TaskRepository.Workspace.WorkspaceTaskRepository.GetTaskRunnerDictionary(IEnumerable`1 lazyTaskRunners)
   at Microsoft.WebTools.TaskRunnerExplorer.TaskRunner.TaskRepository.Workspace.WorkspaceTaskRepository..ctor(IEnumerable`1 taskRunners, IVsFolderWorkspaceService folderWorkspaceService, ITaskRunnerFileParser fileParser, IFileSystem fileSystem, IVsWrappersFactory wrappersFactory, IActiveDocumentService activeDocumentService, IRefreshTaskRunnersEvents taskRunnersEvents)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.ConstructExportedValue(RuntimeImport import, RuntimeExport export, RuntimePartLifecycleTracker importingPartTracker, PartLifecycleTracker partLifecycle, ReportFaultCallback faultCallback)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetExportedValue(RuntimeImport import, RuntimeExport export, RuntimePartLifecycleTracker importingPartTracker, Boolean lazy, PartLifecycleTracker& partLifecycle)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__11_0(RuntimeImport import)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass63_0.<CreateExport>b__0()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass52_3.<GetExports>b__5()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.<>c__DisplayClass10_0.<UnwrapExport>b__1()
   at System.ComponentModel.Composition.Primitives.Export.get_Value()
   at System.ComponentModel.Composition.ReflectionModel.ImportingItem.Cast(Type type, Export export)
   at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport(ImportingItem item, Export[] exports)
   at System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TrySetImport(ImportDefinition import, Export[] exports)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)
   at Microsoft.WebTools.TaskRunnerExplorer.TaskRunnerToolWindow..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Microsoft.VisualStudio.Shell.Package.InstantiateToolWindow(Type toolWindowType, Object context)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass84_0.<CreateToolWindow>g__CreateToolWindowWorker|1()
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags, Object context, Guid persistenceGuid)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass94_1.<<FindToolWindow>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.Package.<>c__DisplayClass94_0.<<FindToolWindow>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Shell.ToolWindowCollection.ToolWindowListener.<>c__DisplayClass1_0.<<-ctor>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.AwaitExtensions.ExecuteContinuationSynchronouslyAwaiter`1.GetResult()
   at Microsoft.VisualStudio.Threading.AsyncLazy`1.<>c__DisplayClass13_0.<<GetValueAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.AsyncLazy`1.GetValue(CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.<ConstructContent>g__ConstructContentFromPackage|145_1(WindowFrame frame)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
wbsimms commented 1 year ago

This is still an issue with 17.6.2

wbsimms commented 8 months ago

This is still an issue with 17.8.1

InspiredEnigma12477 commented 1 month ago

faced a similar issue after updating Visual Studio to 17.10.x

Note the script works in the external Terminal, but not in Task Runner, also used to work before the update (previous version 16.x)

Run npm audit for details.

test@1.0.0 webpack webpack --env.mode development [webpack.Progress] 0% compiling [webpack.Progress] 10% building 0/0 modules 0 active webpack is watching the files… Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (D:\test\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (D:\test\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\test\node_modules\webpack\lib\NormalModule.js:471:10) at D:\test\node_modules\webpack\lib\NormalModule.js:503:5 at D:\test\node_modules\webpack\lib\NormalModule.js:358:12 at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:221:10) at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:236:3 at runSyncOrAsync (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:130:11) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:232:2) at Array. (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at D:\test\node_modules\graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (D:\test\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (D:\test\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\test\node_modules\webpack\lib\NormalModule.js:471:10) at D:\test\node_modules\webpack\lib\NormalModule.js:503:5 at D:\test\node_modules\webpack\lib\NormalModule.js:358:12 at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:221:10) at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:236:3 at runSyncOrAsync (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:130:11) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:232:2) at Array. (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at D:\test\node_modules\graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (D:\test\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (D:\test\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\test\node_modules\webpack\lib\NormalModule.js:471:10) at D:\test\node_modules\webpack\lib\NormalModule.js:503:5 at D:\test\node_modules\webpack\lib\NormalModule.js:358:12 at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:221:10) at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:236:3 at runSyncOrAsync (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:130:11) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:232:2) at Array. (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:205:4) at Storage.finished (D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16) at D:\test\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9 at D:\test\node_modules\graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) [webpack.Progress] 10% building 0/1 modules 1 active D:\test\node_modules\babel-loader\lib\index.js!D:\test\node_modules\ts-loader\index.js??ref--4-1!D:\test\ScriptsSource\App\app.ts node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (D:\test\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (D:\test\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (D:\test\node_modules\webpack\lib\NormalModule.js:471:10) at D:\test\node_modules\webpack\lib\NormalModule.js:503:5 at D:\test\node_modules\webpack\lib\NormalModule.js:358:12 at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:221:10) at D:\test\node_modules\loader-runner\lib\LoaderRunner.js:236:3 at context.callback (D:\test\node_modules\loader-runner\lib\LoaderRunner.js:111:13) at D:\test\node_modules\babel-loader\lib\index.js:59:71 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v18.15.0 Process terminated with code 1.