我打开了VisualStudio 2017(最新-刚刚更新)。我导航到一个类型脚本文件(可能恰好是这种类型的文件),并得到以下提示:
---------------------------
Microsoft Visual Studio
---------------------------
An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file
'C:\...\AppData\Roaming\Microsoft\VisualStudio\15.0_c4122470\ActivityLog.xml'
在我的活动日志中,我收到很多关于软件包的警告:
Unexpected system error mode before loading package <enter package name here>
真正的问题是在文件末尾,我得到一个错误:
System.NullReferenceException: Object reference not set to an instance of an object.
 at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.GetJSFunctionInputsCount()
 at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.Initialize(JSFunctionInfo configInfo)
 at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.InitializeForEditor()
 at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel..ctor(String jsFilePath, Action saveJsFile, Action setJsFileDirty)
 at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMargin..ctor(IWpfTextViewHost textViewHost)
 at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMarginFactory.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
 at
Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp)
 at
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)
--- End of stack trace from previous location where exception was thrown ---
 at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
我努力了:
似乎没有任何帮助。有谁想到这会导致什么?
看来错误或问题是由我正在使用的文件中的JS或TS代码中的反勾引起的。
` <- back tick
这是VS开发人员社区中的一个线程,描述了该问题和潜在的解决方案。
打开javascript文件后出现NullReferenceException
对我而言的解决方案:我必须升级到VS 15.8.1版(对我来说,该错误仍然存在于15.8.0版中,这是我发布问题时所使用的版本)。该版本刚刚发布。
到目前为止,一切工作正常。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句