This project is read-only.
5
Vote

SparkSense throws an exception whenever it runs

description

Whenever I type "${", or "<s:" or just press Ctrl-Space I get the the exception below:
 
279 ERROR System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at SparkSense.Parsing.ProjectExplorer.ScanProjectItemForViews(ProjectItem projectItem) at SparkSense.Parsing.ProjectExplorer.ScanProjectItemForViews(ProjectItem projectItem) at SparkSense.Parsing.ProjectExplorer.ScanProjectItemForViews(ProjectItem projectItem) at SparkSense.Parsing.ProjectExplorer.BuildViewMapFromProjectEnvironment() at SparkSense.Parsing.ProjectExplorer.get_ProjectViewFolder() at SparkSense.Parsing.ProjectExplorer.GetViewFolder() at SparkSense.Parsing.ViewExplorer.InitCurrentView() at SparkSense.Parsing.ViewExplorer..ctor(IProjectExplorer projectExplorer) at SparkSense.StatementCompletion.CompletionSource..ctor(ITextBuffer textBuffer, IProjectExplorer projectExplorer) at SparkSense.StatementCompletion.CompletionListener.TryCreateCompletionSource(ITextBuffer textBuffer) at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.<>c__DisplayClass1.<CreateSourcesForBuffer>b__0(ICompletionSourceProvider provider) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeMatchingFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable1 lazyFactories, Func`2 getter, IContentType dataContentType, Object errorSource) Editor or Editor Extension 2010/08/10 15:49:12.712

comments

Rohland wrote Aug 17, 2010 at 12:27 PM

I am getting a similar result. As soon as I open a spark file and attempt to invoke the intellisense the extension crashes. After reviewing the log file, I found the following exception:

System.ArgumentNullException: Value cannot be null. Parameter name: oldValue at System.String.Replace(String oldValue, String newValue) at SparkSense.Parsing.ProjectExplorer.GetCurrentViewPath() at SparkSense.Parsing.ViewExplorer.InitCurrentView() at SparkSense.Parsing.ViewExplorer..ctor(IProjectExplorer projectExplorer) at SparkSense.StatementCompletion.CompletionSource..ctor(ITextBuffer textBuffer, IProjectExplorer projectExplorer) at SparkSense.StatementCompletion.CompletionListener.TryCreateCompletionSource(ITextBuffer textBuffer) at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.<>c__DisplayClass1.<CreateSourcesForBuffer>b__0(ICompletionSourceProvider provider) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeMatchingFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable1 lazyFactories, Func2 getter, IContentType dataContentType, Object errorSource)

RobertGreyling wrote Aug 18, 2010 at 3:08 PM

I've fixed the bug in my local build for the original issue. This will be released soon, but you can get it from source if you're desperate. @Rohland, I don't think yours is the same issue, it's happening in an entirely different area of the code and I think it might be because you don't have your views in a "Views" folder in the solution. Just guessing, but I'll look into it anyway, I don't want the exception thrown, I'd rather have the IntelliSense just not work.

Rohland wrote Aug 19, 2010 at 8:09 AM

I just realised that I attempted to use the plugin on a webforms project that was recently integrated with MVC. There was a 'Views' folder but I noticed that the folder name was all lowercase. I haven't re-attempted to use the plugin on this specific project, but that may be the issue.

alex_clark wrote Aug 19, 2010 at 10:03 AM

I had this problem - I fixed it by doing the following:

Go through each View folder in the solution and check that Studio hasn't added the same spark file twice to the solution. In my case, it had doubled up a file called details.spark. The solution would compile fine, but the sparksense threw the error.

wrote Jan 14, 2011 at 10:18 PM

vsviridov wrote Jan 4, 2012 at 2:01 AM

+1. I just tried to use it with FubuMVC project and I get same behaviour that @Rohland is describing.

wrote Jan 4, 2012 at 2:08 AM

wrote Feb 14, 2013 at 8:03 PM