U4-6219 - Visual Studio 2013 Crashes When Opening umbraco.sln

Created by Nicholas Westby 31 Jan 2015, 23:24:13 Updated by Sebastiaan Janssen 13 Feb 2015, 09:08:48

I was just trying to improve an Umbraco feature and was doing pretty well until I tried to open umbraco.sln in Visual Studio 2013, which crashes. Looks like I'll have to use Notepad++ to do my development for now.

This issue has already been logged as a Visual Studio bug, but thought I'd log it here as well so you know that people are running into an issue trying to develop for Umbraco: https://connect.microsoft.com/VisualStudio/feedback/details/1032119/visual-studio-2013-update-4-crashing-when-opening-umbraco-source-code

Based on comments on that issue, it may be related to the node_modules folder (I was doing work on a property editor in WebStorm and was planning to do C# work in Visual Studio).


Nicholas Westby 01 Feb 2015, 21:52:06

Note that this is Visual Studio 2013 Update 4. Also, the workaround mentioned in the Connect issue works for me (deleting the node_modules folder).

Sebastiaan Janssen 02 Feb 2015, 07:42:44

This only happens on some people's computers and I don't yet know WHY it happens. You can remove the following from umbraco.sln (just open it in a text editor). Make sure not to commit this change to umbraco.sln though else we'll have to reject your pull request. :)

Project("") = "Umbraco.Web.UI.Client", "http://localhost:3961", "{3819A550-DCEC-4153-91B4-8BA9F7F0B9B4}" ProjectSection(WebsiteProperties) = preProject UseIISExpress = "true" TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5" Debug.AspNetCompiler.VirtualPath = "/localhost_3961" Debug.AspNetCompiler.PhysicalPath = "Umbraco.Web.UI.Client" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3961" Debug.AspNetCompiler.Updateable = "true" Debug.AspNetCompiler.ForceOverwrite = "true" Debug.AspNetCompiler.FixedNames = "false" Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.VirtualPath = "/localhost_3961" Release.AspNetCompiler.PhysicalPath = "Umbraco.Web.UI.Client" Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3961" Release.AspNetCompiler.Updateable = "true" Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" Release.AspNetCompiler.Debug = "False" SlnRelativePath = "Umbraco.Web.UI.Client" DefaultWebSiteLanguage = "Visual C#" StartServerOnDebug = "false" EndProjectSection EndProject

Nicholas Westby 03 Feb 2015, 03:19:58

Looking at the stack trace provided as an attachment to the Connect issue, my guess is that two paths appear to Visual Studio to be the same. Perhaps some of the node_modules files are so deep that they are being truncated by Visual Studio's code and causing a key clash in the dictionary they are being inserted into. Or maybe one of the paths has some funky character (e.g., EOL or something) that is again causing a similar truncation issue. Or maybe a unicode character difference is making two paths appear identical when compared regardless of case (different rules for the file system vs the application logic to determine case). Just some theories, but I bet we could test those theories by using a binary approach and selectively deleting portions of the problem folder (the node_modules folder). That may or may not help, as Umbraco may still require whatever the problematic folders are (i.e., we may be able to find the problem, but not be able to fix it).

Nicholas Westby 10 Feb 2015, 21:03:44

I'm not at home to test this, but my coworker just told me that Visual Studio has trouble opening folders with tons of files/folders. You can apparently get around this (at least in a Website) by marking that folder as hidden. Visual Studio will skip that folder. That might be a useful workaround, though I haven't tested it.

Sebastiaan Janssen 13 Feb 2015, 09:04:50

Commit made by '''Sebastiaan Janssen''' on ''2015-02-13T10:04:35+01:00'' https://github.com/umbraco/Umbraco-CMS/commit/7788452fb7187ab39defbd735d2ec75741a4c8b9

U4-6219 Visual Studio 2013 Crashes When Opening umbraco.sln

#U4-6219 Fixed

Sebastiaan Janssen 13 Feb 2015, 09:08:40

The Umbraco.Web.UI.Client is a website project which is a special VS project that just includes every file it can find in the project, there's no way to exclude files through Visual Studio so node_modules gets included automatically. However, it does respect hidden folders, a fact that we can use to our benefit here.

So, as of this commit, when you run build.bat there's an extra command in there that will set the hidden attribute on the node_modules folder. On earlier commits you can just hide it yourself either using the command attrib +h node_modules in the src\Umbraco.Web.UI.Client folder, or by right-clicking the node_modules folder, choosing properties and then selecting the "hidden" checkbox. You only need to hide the single folder, not all of it's children.

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.1

Due in version: 7.2.2


Story Points: