Solution build output appends 'Object reference not set to an instance of an object. MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()' #61

Closed
RyanONeill1970 opened this Issue Aug 30, 2013 · 7 comments

Projects

None yet

8 participants

@RyanONeill1970

After building a solution with WebEssentials enabled I get the following (benign) output;
========== Rebuild All: 10 succeeded, 0 failed, 0 skipped ==========
30/08/2013 14:19:08: Object reference not set to an instance of an object.
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()
30/08/2013 14:19:08: Object reference not set to an instance of an object.
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()
at MadsKristensen.EditorExtensions.ProjectHelpers.GetRootFolder()

I'm not that good with GitHub so I thought I'd describe where I think the problem is, at least there is one there, not sure if it is the same one.

File: https://github.com/madskristensen/WebEssentials2013/blob/92f23d4bb731811d00daa1f2b399a29de7204c64/EditorExtensions/Helpers/ProjectHelpers.cs

Replace line 22;
Project activeProject = null;
with
Project project = GetActiveProject();

and follow that up with;
if (project == null)
return string.Empty;

I suspect it is failing on line 35 where the active project has not been checked for null.
return activeProject.Properties.Item("FullPath").Value.ToString();

@codingfreak

Same problem here. The last release was not so stable IMHO.

@burrows-martinsmith

As a workaround, select a project or source file in the Solution Explorer. Having the solution, or a project or a solution folder as the highlighted item seems to cause this exception.

@zaus
zaus commented Oct 16, 2013

I was able to reproduce just now (after updating to most recent version) the issue by highlighting an unloaded Project file. It seems to work fine with other loaded projects.

@RyanONeill1970

Still happening with me on normal loaded projects but it isn't a real problem.

@allancm
allancm commented Nov 27, 2013

Ok, I have Visual Studio 2013 Ultimate and the Web Essentials 2013, and I have this error every time I do a compilation in any language, even C++ compilation.

@SLaks
Collaborator
SLaks commented Nov 27, 2013

@allancm That was fixed by #226, which has not yet been released.

@LordDelacroix

+Slaks, no it's still not fixed. I am able to reproduce this issue at will with the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment