none
Getting Exception in C# Console Project

    Question

  • Hi,

    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.

    Exception in Console Project

    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>

    Thanks,

    Sabah Shariq


    Saturday, November 28, 2015 3:03 AM

All replies

  • 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.

    Lots of VS Extensions installed? Visual Studio [2013] Auto Updater...

    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.

    VS2013: An exception has been encountered. This may be caused by an extension.


    La vida loca

    Saturday, November 28, 2015 3:53 AM
  • Hi,

    Is there any necessary to reset the Visual Studio setting by running the command ?

    Thanks,

    Sabah Shariq

    Saturday, November 28, 2015 7:56 PM
  • Thanks for Mr.Monkeyboy's reply.

    Hi Sabah Shariq,

    According to the error message in ActivityLog file, it seems to be caused by a corruption Component Model. Please try to clear the Component Model cache in following folder. Then restart your computer again.

    C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache

    If there has no cache folder or clear it doesn't work, please try to update all extensions through menu Tools -> Extensions and Updates.

    If all above steps doesn't work, then please try reset the Visual Studio settings.

    Best Regards,
    Weiwei

    Monday, November 30, 2015 8:02 AM
    Moderator
  • Okay I will try the above process and get back if any issue happen.

    Thanks,

    Sabah Shariq

    Tuesday, December 1, 2015 9:01 AM
  • Hi Sabah Shariq,

    I will waiting for your response. If you have resolved your problem, please share the solution here and mark the helpful reply as answer, which is benefit to other communities who has the same problem. If not, please feel free to come back.

    Best Regards,
    Weiwei

    Wednesday, December 2, 2015 1:42 AM
    Moderator
  • Hi Weiwei Cai,

    Deleting cache and updating extensions didn't solve the problem. I try to reset Visual Studio using the following command from MSDN in command prompt in administrator mode but its not resetting.

    Devenv.exe /ResetSettings "C:\My Files\MySettings.vssettings"

    Thanks,

    Sabah Shariq

    Friday, December 4, 2015 10:51 AM
  • Hi Sabah Shariq,

    To reset VS settings:

    Open your VS, TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings. Check it again. Hope it could help.

    Please also run your VS in safe mode, check it again.

    https://msdn.microsoft.com/en-us/library/ms241278.aspx

    Reference:

    http://blog.meidianto.com/2010/05/16/vs2010-tips-8-got-annoying-visual-studio-2010-error-try-to-run-in-safe-mode/

    Based on the error, it means that it would be related to the extensions, maybe you could really disable the extension in your VS IDE, and then make sure that which extension really impacts your VS IDE.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 7, 2015 2:07 AM
    Moderator