microsoft / nodejstools

Node.js Tools for Visual Studio
http://aka.ms/explorentvs
Apache License 2.0
1.79k stars 359 forks source link

Exception while open any js or css file in node project folder? #1185

Closed babarqb closed 7 years ago

babarqb commented 8 years ago

Every time i open or create a file inside folder of nodjs project it through exception but if i create or open file from root of project no exception throw. activity.xml error is mention below

<entry>
    <record>819</record>
    <time>2016/07/31 19:19:05.919</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.InvalidOperationException: Operation is not valid due to the current state of the object.&#x000D;&#x000A;   at Microsoft.VisualStudioTools.Project.Automation.OAProjectItem.get_Collection()&#x000D;&#x000A;   at Microsoft.VisualStudio.Web.Editor.Package.Lint.WebLinter.LinterUtilities.IsFileSupported(String fileName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Web.Editor.Package.Lint.ErrorTagger.LintErrorTaggerProvider.CreateTagger[T](ITextBuffer textBuffer)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)</description>
  </entry>
mjbvz commented 8 years ago

Thanks for reporting this problem.

I'm unable to repo the issue in my testing and the Microsoft.VisualStudio.Web.Editor.Package.Lint error message suggests this is not an NTVS issue.

Thanks.

robbie-mac commented 8 years ago

@mjbvz Hey Matt, I'm having the same issue popping up, and can answer a few of your questions:

I have not seen this error for .css files, so I can not comment on that, however I am going to attach my whole activitylog.xml (minus the personally identifiable stuff. There are a few errors happening. ActivityLog.zip

[EDIT: This post is going to seem untrue when you read the next post, but bare with me. I installed a few extensions out of habit, and didn't even think about it. My bad.]

robbie-mac commented 8 years ago

@babarqb @mjbvz Ok, so after a bunch of trying to fix the exception, and poking in things WAY over my head... not really, just too lazy to get into the nuts and bolts of this, I remembered that this type of problem poked its head up before (#371 might be similar issue).

So checking into maybe the chance that the error messages were in fact pointing me in the right direction, I began to look at my extensions. Some of them were disabled (Not by me) so I thought maybe something was wrong. I cleared my MEF Cache a few times, and uninstalled the disabled extensions, and cleared my cache again, and voila. No more exception, and everything works fine now.

So @babarqb , try clearing your MEF Cache ( Mads Kristensen has an extension to help with that... that sounded like an Apple commercial ) give it a whirl. Then check your extensions to see if any are disabled, if there are remove them, clear your cache again and see if that helps.

mleanos commented 8 years ago

I'm experiencing this exact exception. I've cleared my MEF Cache, and performed the DevEnv.exe /setup task. I didn't notice any disabled extensions. The problem still persists.

Another thing that I've notice is that my automatic brace completion is not working on Node.js projects. However, it's working for .js files in my .NET projects. Not sure if this is related.

Visual Studio 2015 Community Update 3 NTVS 1.2.40726.00 Node v4.3.1

robbie-mac commented 8 years ago

Ive noticed that its a reccuring thing that keeps popping up. I think the problem stems from extensions getting updated impropely. Ive had to uninstall some extension... and then uninstall them again because 2 versions are registered. Once this is done then the error goes away. I don't know why this happens or why my solution works... just that it does, and its a pain, and its not NTVS fault.

BalassaMarton commented 8 years ago

I have the same problem, with the following setup: Visual Studio 2015 Professional Update 3 NTVS 1.2.40726.00 Node 6.5.0 Clearing the cache, reinstalling NTVS, Node, etc. didn't make it go away.

sonealtx commented 7 years ago

I'm having the same problem:

Visual Studio Enterprise 2015 Update 3 NTVS: 1.2.40726.00 Node: 4.6.0

I've tried clearing the MEF cache, reinstalling NTVS, Node. Deleting the folder: %localappdata%\Microsoft\VisualStudio\14.0.

None of those things are working for me. I've also noticed that my auto brace completion is not working nor the intellisense. Thanks

jawa-the-hutt commented 7 years ago

Having the same problem.

fresh load of Windows 10 1607 on a brand new laptop. VSE 2015 Update 3 NTVS 1.2.40726.00 Node 6.8

Have had the problem for a couple of months now with the previous OS load, but was hoping it would go away with the new laptop.

HoosierMike commented 7 years ago

Same problem here, not good, we're screwed ... Update 3 was not tested with Typescript at all

mjbvz commented 7 years ago

Sorry for the delay handling this. I've been coordinating with the Web Tools team to fix this on their side, but also have merged a PR #1386 that should workaround this on the NTVS side. Try picking up the next dev build to try this out.