如何确定哪个扩展有问题,以及如何解决异常?

How can I determine which extension is problematic, and how to resolve the exception?

在 VS 2013 中打开我的 ASP.NET 网页解决方案(我在 WebMatrix 中开始)时,我现在收到此错误消息:

An exception has been encountered. This may be caused by an extension. You can get more information by examing the file '...\AppData\Roaming\Microsoft\VisualStudio.0\ActivityLog.xml'

我搜索了 "exception" 这个词,发现了这个:

<description>
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.JSLS.Extensibility.IJavaScriptServicesProvider&#x000
A;&#x0009;RequiredTypeIdentity&#x0009;Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider&#x000D;
&#x000A;&#x000D;&#x000A;Resulting in: Cannot set import 
&apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter._javaScriptServicesProvider 
(ContractName=&quot;Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider&quot;)&apos; on part 
&apos;Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter&apos;.&#x000D;&#x000A;Eleme
nt: Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter._javaScriptServicesProvider 
(ContractName=&quot;Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider&quot;) --&gt;  
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter&#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 System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce
(ICompositionService compositionService, Object attributedPart)&#x000D;&#x000A;   at 
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter..ctor(ITextView 
textView)&#x000D;&#x000A;   at 
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.WpfTextViewConnectionListener.HookupCommandFilter
(IWpfTextView textView, IVsTextView textViewAdapter)&#x000D;&#x000A;   at 
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.WpfTextViewConnectionListener.SubjectBuffersConnecte
d(IWpfTextView textView, ConnectionReason reason, Collection`1 subjectBuffers)&#x000D;&#x000A;   at 
Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.&lt;&gt;c__DisplayClass8.&lt;.ctor&gt;b__1
()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object 
errorSource, Action call)
</description>

...但它仍然不能告诉我太多,AFAICT。哪个扩展导致了问题,我该怎么办?

然后我搜索了 "extension" 并找到了这些条目:

  <entry>
    <record>954</record>
    <time>2015/03/26 15:39:58.007</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [MadsKristensen.Image_Optimizer_Extension.Image_Optimizer_ExtensionPackage, 
Image Optimizer Extension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16b83d3f826a86c5]</description>
    <guid>{BF95754F-93D3-42FF-BFE3-E05D23188B08}</guid>
  </entry>
  <entry>
    <record>955</record>
    <time>2015/03/26 15:39:58.491</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [MadsKristensen.Image_Optimizer_Extension.Image_Optimizer_ExtensionPackage, 
Image Optimizer Extension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16b83d3f826a86c5]</description>
    <guid>{BF95754F-93D3-42FF-BFE3-E05D23188B08}</guid>
  </entry>

...和:

  <entry>
    <record>963</record>
    <time>2015/03/26 15:40:13.623</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [JavaScriptWebExtensionsPackage]</description>
    <guid>{30DB8F9B-EC9F-44D6-B377-83C7C27A1A8B}</guid>
  </entry>
  <entry>
    <record>964</record>
    <time>2015/03/26 15:40:13.717</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>End package load [JavaScriptWebExtensionsPackage]</description>
    <guid>{30DB8F9B-EC9F-44D6-B377-83C7C27A1A8B}</guid>
  </entry>
  <entry>

...但似乎 "exception" 条目是关键条目。

我的猜测是 JavaScript 扩展名被关闭了,因为 JavaScript 不再是彩色的 - 它只是黑底白字:

不过,我不知道该怎么办。

注意:这个项目确实打开了前几次,无一例外。它只是决定不喜欢昨晚的一些延期。发生了什么变化?

无论如何,整个ActivityLog.xml都可以从here

访问

更新

我的 jQuery 恢复了颜色;也许它与更新几个软件包有关,NE 角落 "Quick Launch" 旁边的标志试图引起我的注意。这些是:

  1. 开发助理
  2. 图像优化器
  3. 从 Azure 网站打开
  4. VS 的发布管理工具(我第一次尝试安装它时失败了,必须 运行 VS 作为管理员才能 take

发生这种情况时,请检查 VS 东北角的 "race car flag",看看它是否通知您任何更新;如果是这样,请应用这些更新。这对我有用。具体来说,我更新了:

  1. 开发助理
  2. 图像优化器
  3. 从 Azure 网站打开
  4. VS 的发布管理工具

...问题消失了。