madskristensen / BundlerMinifier

Visual Studio extension
Other
616 stars 172 forks source link

VS2015 becomes non responsive when incudeInProject=true #201

Open dammitjanet opened 7 years ago

dammitjanet commented 7 years ago

Installed product versions

Description

VisualStudio becomes unresponsive when the following conditions are met

Steps to recreate

  1. Have a bundleConfig.json that contains a slightly different named input and outputFile and with includeInProject set to true (the default) e.g.
    [
    {
    "outputFileName": "test.min.css",
    "inputFiles": [
      "test.src.css"
    ]
    }
    ]
  2. Make a change to the source file test.src.css
  3. Click Save (or Ctrl-S, or close the document and save on exit)
  4. VS becomes unresponsive

Current behavior

The minification process works as expected, however it would appear that the 'BundleService.AfterWritingFile' event fails when includeInProject=true causing VS to become unresponsive. More specifically, the issue occurs because the ProjectHelpers.AddNestedFile fails at this point because the filename being passed already exists and is already in the project

//newFile = "test.min.css"
                else if (_dte.Solution.FindProjectItem(newFile) == null || force)
                {
                    item.ProjectItems.AddFromFile(newFile);
                }

Expected behavior

Don't cause VS to die.

Workaround - add "includeInProject": false

  {
    "outputFileName": "test.min.css",
    "includeInProject": false,
    "inputFiles": [
      "test.src.css"
    ]
  }
Rob-Newman commented 7 years ago

I am also experiencing the same issue when the bundled files already exist in the project.

ericop commented 7 years ago

This is happening for me too. Every time I save a change in any input file, VS2015 becomes "Not Responding" and I have to force the task closed. Really painful!

rufterrain commented 7 years ago

I am also experiencing this issue. VS only crashes if I have the extension enabled.

drew-fierst commented 7 years ago

I am experiencing this issue as well. I LOVED this extension until it started hanging VS a month or two ago. Now it is quite consistently annoying. Disable the extension and no issues, but no bundling either :( (Did try uninstalling the extension and reinstalling, no joy. Extension version 2.3.330, VS version 14.0.25431.01 Update 3 )

valeriob commented 7 years ago

Same problem here, is astonishing how lack of attention this fundamental extension has received :(

austinw-fineart commented 6 years ago

This issue still exists on the latest version of the extension. I am using it with a .NET Framework project.

Installed product versions

irahsu commented 5 years ago

Same issue for me. VS2017 Community 15.9.2 Bundler & Minifier 2.8.396.

aaronhudon commented 5 years ago

This is happening for me by simply adding a new C# file to a project. Pretty frustrating.