c# - 任务运行器资源管理器不工作

标签 c# visual-studio npm gulp task-runner-explorer

我在 VS2015 社区中制作的项目中应用了 Gulp。但是当我使用 Task Runner Explorer 时,会出现一个对话框,提示“Exception has been throwed by the target of an invocation.”我尝试在“配置外部 Web 工具”中执行(PATH)操作但这根本没有帮助。

NPM 安装正常,Gulp 正常执行。

我正在使用以下版本

  • .NET Framework 4.6.1
  • Gulp v1.3.15
  • npm v1.3.15
  • 节点 v5.3.0

此外,当我运行项目并打开 Task Runner Explorer 时,出现以下异常:

An exception was encountered while constructing the content of this frame.  This information is also logged in "C:\Users\marvin\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml".
Exception details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.TaskRunnerExplorer.TaskRunnerUserControl.InitializeControl(Object sender, EventArgs e)
   at System.Windows.FrameworkElement.RaiseInitialized(EventPrivateKey key, EventArgs e)
   at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
   at System.Windows.FrameworkElement.TryFireInitialized()
   at System.Windows.FrameworkElement.EndInit()
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
   at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
   at System.Xaml.XamlObjectWriter.Logic_EndInit(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteEndObject()
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Microsoft.VisualStudio.TaskRunnerExplorer.TaskRunnerUserControl.InitializeComponent()
   at Microsoft.VisualStudio.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.RuntimeType.CreateInstanceDefaultCtor(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)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
   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 Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

最佳答案

我遇到了同样的错误,注意到我的 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools 目录是空的。

通过重新安装 修复它 Microsoft ASP.NET and Web Tools 扩展。

关于c# - 任务运行器资源管理器不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38378496/

相关文章:

c# - 下拉大小设置未采用

c# - 关闭 using block 中的连接

wpf - 程序员编辑 XAML 的最佳方式

node.js - npm 完全不起作用 : "Error: Cannot find module ' isarray'"

javascript - 减少对象数组: limit similar fields based on value from another field

c# - 在代码中设置静态资源

c# - 为什么 FileSystemWatcher 关闭程序?

visual-studio - BadImageException : 'Could not load file or assembly ' Microsoft. VisualStudio.QualityTools.VideoRecorderEngine'或其依赖项之一。

.net - 我可以在 Visual Studio 中的代码块的注释中添加链接吗?

javascript - WebStorm eslint-config-标准错误