Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

SharpDevelop 5: Error when opening solution

$
0
0

I get this error when opening one of my solutions. Another solution, the error doesn't happen until i actually open one of the files.

Both solutions open fine in SharpDevelop 4.3.

In SharpDevelopSolutionSnapshot.cs, line 20, I changed

            if (projects != null) {
                foreach (IProject project in projects) {
                    var pc = project.ProjectContent;
                    if (pc != null)
                        projectContentSnapshots.Add(project, pc);
                }
            }

to

            if (projects != null) {
                foreach (IProject project in projects) {
                    var pc = project.ProjectContent;
                    if (pc != null && !projectContentSnapshots.ContainsKey(project))
                        projectContentSnapshots.Add(project, pc);
                }
            }

and it seems to work fine, but wasn't able to track down why it was adding the project twice.

SharpDevelop Version : 5.0.0.3247-newNR-alpha-8d5347a9
.NET Version         : 4.0.30319.18052
OS Version           : Microsoft Windows NT 6.1.7601 Service Pack 1
Current culture      : English (United States) (en-US)
Running under WOW6432, processor architecture: x86-64
Working Set Memory   : 460008kb
GC Heap Memory       : 211575kb

Unhandled WPF exception
Exception thrown:
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at ICSharpCode.SharpDevelop.Parser.SharpDevelopSolutionSnapshot..ctor(IEnumerable`1 projects)
   at ICSharpCode.SharpDevelop.Parser.ParserService.GetCurrentSolutionSnapshot()
   at ICSharpCode.SharpDevelop.Parser.ParserService.GetCompilationForFile(FileName fileName)
   at ICSharpCode.AvalonEdit.AddIn.QuickClassBrowser.DoUpdate(IUnresolvedFile unresolvedFile)
   at ICSharpCode.AvalonEdit.AddIn.QuickClassBrowser.ComboBox_DropDownClosed(Object sender, EventArgs e)
   at ICSharpCode.AvalonEdit.AddIn.QuickClassBrowser.Update(IUnresolvedFile compilationUnit)
   at ICSharpCode.AvalonEdit.AddIn.CodeEditor.ParseInformationUpdated(ParseInformation parseInfo)
   at ICSharpCode.AvalonEdit.AddIn.CodeEditor.<ParserServiceParseInformationUpdated>b__4()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


Viewing all articles
Browse latest Browse all 1764

Trending Articles