在 VS 2013 中打开我的 ASP.NET 网页解决方案(我从 WebMatrix 开始)时,我现在收到了这个错误消息:
遇到异常。这可能是由扩展引起的。您可以通过检查文件“...\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml”来获取更多信息
我搜索了“异常”这个词,发现了这个:
<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.

1) No exports were found that match the constraint:

	ContractName	Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider�
A;	RequiredTypeIdentity	Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider


Resulting in: Cannot set import
'Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter._javaScriptServicesProvider
(ContractName="Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider")' on part
'Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter'.
Eleme
nt: Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter._javaScriptServicesProvider
(ContractName="Microsoft.VisualStudio.JSLS.Extensibility.IJavaScriptServicesProvider") -->
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter


at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition
atomicComposition)
 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.VisualStudio.JavaScript.Web.Extensions.Commands.CommandFilter..ctor(ITextView
textView)
 at
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.WpfTextViewConnectionListener.HookupCommandFilter
(IWpfTextView textView, IVsTextView textViewAdapter)
 at
Microsoft.VisualStudio.JavaScript.Web.Extensions.Commands.WpfTextViewConnectionListener.SubjectBuffersConnecte
d(IWpfTextView textView, ConnectionReason reason, Collection`1 subjectBuffers)
 at
Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.<>c__DisplayClass8.<.ctor>b__1
()
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object
errorSource, Action call)
</description>
...但它仍然没有告诉我太多,AFAICT。什么扩展导致了问题,我该怎么办?
然后我搜索“扩展名”并找到这些条目:
<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>
...但似乎“异常”条目是关键。
我的猜测是 JavaScript 扩展是被冲洗掉的,因为 JavaScript 不再是彩色的——它只是黑底白字:
不过,我不知道该怎么办。
注意:这个项目确实打开了前几次,无一例外。它只是决定它不喜欢昨晚的一些扩展。发生了什么变化?
反正整个ActivityLog.xml都可以从这里访问
更新
我的 jQuery 又恢复了颜色;也许它与更新NE角落“快速启动”旁边的标志试图引起我注意的几个软件包有关。这些曾经是:
- 开发者助理
- 图像优化器
- 从 Azure 网站打开
- VS的发布管理工具(我第一次尝试安装它失败了,必须以管理员身份运行VS才能使用它)