Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
RyanONeill1970 opened this Issue · 7 comments

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.

@mlorbetske mlorbetske referenced this issue from a commit
@mlorbetske mlorbetske Issue #38, Issue #61 & Issue #70
Also a fix for the Unused CSS extension, preventing a
NullReferenceException when adding a LESS mixin
af859ad
@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

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

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

@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
Something went wrong with that request. Please try again.