在C#控制台项目中获取异常 [英] Getting Exception in C# Console Project

查看:83
本文介绍了在C#控制台项目中获取异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio2013.它工作正常,但突然在创建新的C#控制台项目时收到此异常消息. 遇到异常.这可能是由于扩展引起的.请注意,当我创建 一个新的C#WinForm或ASP.Net项目,我没有收到此异常消息.而且我的Visual Studio中未安装任何更改或扩展.我已在下面附上了屏幕截图.

I am using Visual Studio 2013. It was working fine but suddenly I am getting this exception message when I create a new C# Console project. "An exception has been encountered. This may be caused by an extension." Please note that when I create a new C# WinForm or ASP.Net project I don't get this exception message. And no changes or extension has been install in my Visual Studio. I have attached a screenshot below.

当我查看ActivityLog时,发现以下错误消息:

When I look into the ActivityLog I found this error message:

<entry>
    <record>1492</record>
    <time>2015/11/27 17:45:20.827</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <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) Could not load file or assembly &apos;Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: An exception occurred while trying to create an instance of type &apos;Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider&apos;.&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot activate part &apos;Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider --&gt;  Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider&#x000D;&#x000A;&#x000D;&#x000A;Resulting in: Cannot get export &apos;Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider (ContractName=&quot;Microsoft.VisualStudio.Language.Intellisense.ICodeLensDataPointProvider&quot;)&apos; from part &apos;Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider&apos;.&#x000D;&#x000A;Element: Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider (ContractName=&quot;Microsoft.VisualStudio.Language.Intellisense.ICodeLensDataPointProvider&quot;) --&gt;  Microsoft.VisualStudio.CodeSense.Providers.Collaboration.AuthorsDataPointProvider&#x000D;&#x000A;&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart)&#x000D;&#x000A;   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()&#x000D;&#x000A;   at System.ComponentModel.Composition.Primitives.Export.get_Value()&#x000D;&#x000A;   at System.ComponentModel.Composition.ExportServices.GetCastedExportedValue[T](Export export)&#x000D;&#x000A;   at System.ComponentModel.Composition.ExportServices.&lt;&gt;c__DisplayClass4`2.&lt;CreateStronglyTypedLazyOfTM&gt;b__1()&#x000D;&#x000A;   at System.Lazy`1.CreateValue()&#x000D;&#x000A;   at System.Lazy`1.LazyInitValue()&#x000D;&#x000A;   at System.Lazy`1.get_Value()&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.IndicatorCollection.&lt;&gt;c__DisplayClass11.&lt;UpdateTemplateCollection&gt;b__c()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)</description>
  </entry>
  <entry>

谢谢

沙巴沙里克(sabah Shariq)

Sabah Shariq

推荐答案

Visual Studio 2013能够自动更新已安装的扩展.也许发生了.我没有Visual Studio 2013,也不知道对已安装的扩展程序进行自动更新是否会导致类似的问题.您可能要检查是否自动更新 正在为已安装的扩展程序运行.

Visual Studio 2013 has the ability to autoupdate installed extensions. Maybe that occured. I don't have Visual Studio 2013 and don't know if an autoupdate to an already installed extension could cause an issue like that. You may want to check if autoupdate is running for installed extensions.

很多VS扩展安装? Visual Studio [2013]自动更新程序...

另外,根据以下链接,您的Temp目录可能已满.在Win 7中,我的用户位于"C:\ Users \ John \ AppData \ Local \ Temp"并使用开始"菜单中的搜索文本框,您可以输入%temp%,该值应显示 该临时文件夹,甚至更多.我每天清洗一次.

Also it may be that your Temp directory is full according to the below link. On Win 7 for my user that would be located at "C:\Users\John\AppData\Local\Temp" and using the search textbox in the Start Menu you can type in %temp% which should display that temp folder and maybe more. I clean mine once a day.


这篇关于在C#控制台项目中获取异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆