Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

#D fails to start when last solution fails to load at startup #401

@galich

Description

@galich

I had a blocker issue with ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.LoadProjectExtensions() method throwing exception on some of my projects. #D loads last solution after start and if loads fails - then SD fails completely.

It happened on attempt to load SharpDevelopExtensions section from solution/project when this section was not there.

The exception thrown at return XElement.Parse(existing[name]); when existing[name] returned empty string.

My local fix was to treat empty element as null, I'm not sure if it's the best/right place to do it though :)

public override XElement LoadProjectExtensions(string name)
{
    lock (SyncRoot) {
        ProjectExtensionsElement existing = GetExistingProjectExtensionsElement();

        if (existing != null) {
            string xml = existing[name];

            if(!string.IsNullOrWhiteSpace(xml))
                return XElement.Parse(existing[name]);
        }

        existing = projectFile.CreateProjectExtensionsElement();
        return new XElement(name);
    }
}

In fact there are 2 issues here:

  1. exception when loading a solution at startup kills SharpDevelop process
  2. SharpDevelopExtensions project extensions element might be absent/empty

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions