【问题标题】:How can I determine which extension is problematic, and how to resolve the exception?如何确定哪个扩展有问题,以及如何解决异常?
【发布时间】:2015-05-30 18:14:26
【问题描述】:

在 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.&#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。什么扩展程序导致了问题,我该怎么办?

然后我搜索“扩展名”并找到以下条目:

  <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可以从here访问

更新

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

  1. 开发者助理
  2. 图像优化器
  3. 从 Azure 网站打开
  4. 用于 VS 的发布管理工具(我第一次尝试安装时失败,必须以管理员身份运行 VS 才能使用

【问题讨论】:

  • 看看here可能对你有帮助

标签: asp.net webmatrix asp.net-webpages activitylog


【解决方案1】:

发生这种情况时,请检查 VS 东北角的“赛车标志”,看看它是否会通知您任何更新;如果是这样,请应用这些更新。这在我的情况下有效。具体来说,我更新了:

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

...问题就解决了。

【讨论】:

  • 感谢您的帖子。我不得不更新Microsoft Azure,它似乎工作。但是,在重新启动 Visual Studio 2015 后,我在尝试添加 ADO.NET 实体数据模型时遇到了同样的错误。此处发布的答案对我有帮助:stackoverflow.com/a/31899210/1244630
猜你喜欢
  • 2019-10-10
  • 2012-12-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-01-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多