none
Codelens fails to load

    Question

  • Hey experts!

    Recently switched to VS2015. It's incredibly laggy when typing code, there's no codelens, and when it starts up it always prompts that an exception occurred and more info might be in ActivityLog.xml...

    There is, but it makes no sense to me. Suggestions? :)

     <entry>
        <record>635</record>
        <time>2016/02/25 16:23:35.524</time>
        <type>Error</type>
        <source>Editor or Editor Extension</source>
        <description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.&lt;&gt;c__DisplayClass22_0.&lt;CreateIndicator&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensDataPointTemplateService.CreateIndicator(ICodeLensDescriptor descriptor, String dataPointProviderName, Func`1 viewModelReferenceFactory)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.CreateIndicator(ICodeLensDescriptor descriptor, Lazy`2 provider)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.IndicatorCollection.UpdateTemplateCollection()&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.IndicatorCollection.Connect()&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.IndicatorCollection..ctor(CodeLensIndicatorService indicatorService, ICodeLensDescriptor descriptor)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensIndicatorService.CreateIndicatorCollection(ICodeLensDescriptor descriptor)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensAdornmentViewModelProvider.CreateAdornmentViewModel(ICodeLensDescriptor descriptor)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensAdornmentCache.GetOrCreateCacheEntry(ICodeLensTag tag)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensAdornmentCache.GetOrCreateAdornment(ICodeLensTag tag)&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensInterLineAdornmentTaggerProvider.CodeLensInterLineAdornmentTagger.AdornmentHost.TryConnectAdornment()&#x000D;&#x000A;   at Microsoft.VisualStudio.Language.Intellisense.Implementation.CodeLensInterLineAdornmentTaggerProvider.CodeLensInterLineAdornmentTagger.&lt;&gt;c__DisplayClass41_0.&lt;CreateDelayedAdornments&gt;b__0()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint[T](Object errorSource, Func`1 call, T valueOnThrow)</description>
      </entry>
    


    Keep rocking LS!
    Jan

    PS: have you seen app-stitch yet? It's a visually simple yet powerful way of designing business rules for Visual Studio LightSwitch apps.

    Thursday, February 25, 2016 4:31 PM

Answers

  • Hey Jack!

    Yes, it is an extension issue, but the extension is CodeLens. The ActivityLog.xml very clearly places the issue in the CodeLens' stacktrace.

    I ran Visual Studio in safemode, but the exception remains. I honestly do not think this is because of a 3rd party extension.

    Also, and this is the major breakthrough... I went into options and disabled CodeLens. Obviously, then I don't get the exception anymore. Now, I tried to turn Codelens back on with all features disabled, and it worked. I tried turning on every feature one by one and if I turn the TFVC related codelens features on, my Visual Studio crashes on the spot!  In other words: I can get codelens to work as long as I do not turn on any of the TFVC features!!

    Any bells ringing? :)



    Thanks!!
    Jan

    Wednesday, March 2, 2016 9:54 AM
  • Hi Jan,

    I know, this issue is quite outdated, but maybe you still need some help?

    I suddenly had the same problem and disabling TFVC items did "remove" the error message. But - probably like you - I wanted the CodeLens feature back.

    After some hours playing around, using the ResetSkipPkgs and also the SafeMode option, loading old settings, reloading my recent settings again, without any luck, I just reset the settings and it went away with CodeLens fully active.

    Maybe you give it a try, if you didn't do this yet?

    Cheers, Dany
    • Edited by DanyR_ Friday, September 30, 2016 8:28 PM double cheers ;)
    • Marked as answer by Jan Van der Haegen Friday, September 30, 2016 8:33 PM
    Friday, September 30, 2016 8:28 PM
  • Hi Jan,

    >>I tried turning on every feature one by one and if I turn the TFVC related codelens features on, my Visual Studio crashes on the spot!  In other words: I can get codelens to work as long as I do not turn on any of the TFVC features.

    As far as I know, TFVC –> Both on-premises Team Foundation Server (TFS) and Visual Studio Online (VSO). So you could connect the version control tool TFS in the Team Explorer window, am I right?

    As you said that it worked well after you turn off the TFVC features, maybe we would think about the TFS OR VSO Environment. Of course, to really make sure that whether it is related to the TFS or the VSO, just clean up the connection in your team explorer window, just use the singly VS IDE without using the TFS/VSO, and then you could enable the TFVC options, check it again. If VS works normally, I think the real issue would be not the VS IDE issue, it would be related to the TFVC.

    Of course, if possible, please also test it in other VS machine using the same TFS or VSO, check it again. If it still has the crashed issue, we could make sure that it would be not the VS IDE issue.

    Some members met the issue “CodeLens not work” before, but it worked normally after they reset the VS settings.

    TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings. 

    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.


    Thursday, March 3, 2016 3:00 AM
    Moderator

All replies

  • Hi Jan,

    Did it has this issue when you open your VS for the first time after you setup it?

    Maybe certain packages met the loaded issue, to make sure that it is not related to certain add-ins or extension tools in your VS IDE, please run your VS in safe mode, check it again.

    Devenv.exe /SafeMode

    Reference:

    https://msdn.microsoft.com/en-us/library/ms241278.aspx?f=255&MSPPError=-2147217396

    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.

    Friday, February 26, 2016 8:18 AM
    Moderator
  • Hey Jack!

    "Did it has this issue when you open your VS for the first time after you setup it?" => I unfortunately don't remember, the 'first time' was a while ago as I was locked out of VS2015 for a while when the trial expired and it failed to recognize my MSDN account as a valid license.

    I tried /SafeMode, but the effect is the same. When I open a project or start a new, I get the message than an error occured, more info is in ActivityLog.xml, with the same contents as copied above.

    Also, I do not have a lot of external tools/addins installed (Github for VS, Devexpress reporting, Telerik Decompiler).  After today's working day, I'll try to remove all external addins and report on progress!

    Thanks

    J


    Thanks!!
    Jan

    Friday, February 26, 2016 11:30 AM
  • Hi Jan,

    >>Also, I do not have a lot of external tools/addins installed (Github for VS, Devexpress reporting, Telerik Decompiler).  After today's working day, I'll try to remove all external addins and report on progress!

    What about this issue after you disable/remove the add-ins in your side? Would you mind letting us know that latest information about this issue?

    If it still has this issue, we would think about the VS setup.

    Run the command line:

    Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.

    Or you could repair your VS from the control panel, re-open your VS, check the result.

    But if still no help, please use http://aka.ms/vscollect  to gather the VS and .Net Frameowrk installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to One drive and share the link here.

    Thanks,

    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, February 29, 2016 2:57 AM
    Moderator
  • Hey Zack!

    Thanks for the suggestions.

    Both repair or the resetskippkgs did not work, loading a project results in the same exception.

    I'm uploading the vslogs.zip (is it supposed to be .cab? I only found .zip) to OneDrive now. Will share in a wee bit.

    Thank you in advance!


    Thanks!!
    Jan

    Monday, February 29, 2016 6:30 PM
  • Hey Zack!

    I uploaded the logs here... Sure hope something makes sense to you!!!

    Thank you

    J


    Thanks!!
    Jan

    Tuesday, March 1, 2016 7:15 AM
  • Hi Jan,

    It seems that no VS setup error.

    >>Editor or Editor Extension: System.NullReferenceException: Object reference not set to an instance of an object.

    Like this connect report I met before even if it was about the old VS version:

    https://connect.microsoft.com/VisualStudio/feedback/details/773274/text-editor-exception-at-startup#details

    Generally it would be related to the extension tools, do you install any VS extension tools in your VS IDE after you install it?

    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.

    Wednesday, March 2, 2016 6:43 AM
    Moderator
  • Hey Jack!

    Yes, it is an extension issue, but the extension is CodeLens. The ActivityLog.xml very clearly places the issue in the CodeLens' stacktrace.

    I ran Visual Studio in safemode, but the exception remains. I honestly do not think this is because of a 3rd party extension.

    Also, and this is the major breakthrough... I went into options and disabled CodeLens. Obviously, then I don't get the exception anymore. Now, I tried to turn Codelens back on with all features disabled, and it worked. I tried turning on every feature one by one and if I turn the TFVC related codelens features on, my Visual Studio crashes on the spot!  In other words: I can get codelens to work as long as I do not turn on any of the TFVC features!!

    Any bells ringing? :)



    Thanks!!
    Jan

    Wednesday, March 2, 2016 9:54 AM
  • Hi Jan,

    >>I tried turning on every feature one by one and if I turn the TFVC related codelens features on, my Visual Studio crashes on the spot!  In other words: I can get codelens to work as long as I do not turn on any of the TFVC features.

    As far as I know, TFVC –> Both on-premises Team Foundation Server (TFS) and Visual Studio Online (VSO). So you could connect the version control tool TFS in the Team Explorer window, am I right?

    As you said that it worked well after you turn off the TFVC features, maybe we would think about the TFS OR VSO Environment. Of course, to really make sure that whether it is related to the TFS or the VSO, just clean up the connection in your team explorer window, just use the singly VS IDE without using the TFS/VSO, and then you could enable the TFVC options, check it again. If VS works normally, I think the real issue would be not the VS IDE issue, it would be related to the TFVC.

    Of course, if possible, please also test it in other VS machine using the same TFS or VSO, check it again. If it still has the crashed issue, we could make sure that it would be not the VS IDE issue.

    Some members met the issue “CodeLens not work” before, but it worked normally after they reset the VS settings.

    TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings. 

    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.


    Thursday, March 3, 2016 3:00 AM
    Moderator
  • Hi Jan,

    I know, this issue is quite outdated, but maybe you still need some help?

    I suddenly had the same problem and disabling TFVC items did "remove" the error message. But - probably like you - I wanted the CodeLens feature back.

    After some hours playing around, using the ResetSkipPkgs and also the SafeMode option, loading old settings, reloading my recent settings again, without any luck, I just reset the settings and it went away with CodeLens fully active.

    Maybe you give it a try, if you didn't do this yet?

    Cheers, Dany
    • Edited by DanyR_ Friday, September 30, 2016 8:28 PM double cheers ;)
    • Marked as answer by Jan Van der Haegen Friday, September 30, 2016 8:33 PM
    Friday, September 30, 2016 8:28 PM
  • Hey  Dany!

    I'm happy without CodeLens' TVFC features. Even if it were to work, I really like to run my VS as slim as possible nowadays ;-D

    However thank you for posting back. I'm sure there's many people that will come here in the future and appreciate your response.

    Have a great one!

    J


    Thanks!!
    Jan

    Friday, September 30, 2016 8:35 PM