Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio hangs when building a Blazor project (15.8.0) #15679

Closed
MarkStega opened this issue Aug 16, 2018 · 25 comments
Closed

Visual Studio hangs when building a Blazor project (15.8.0) #15679

MarkStega opened this issue Aug 16, 2018 · 25 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@MarkStega
Copy link

I tried to report a VS issue using the feedback system with

"I have a Blazor based solution with 6 DLL's built with the Blazor tooling that are all .Net Standard 2.0 and one that is ASP.Net Core 2.1

Up until yesterday, this solution built properly with VS 15.7, I upgraded to VS 15.8 and now the build hangs after I make a source change and do either Ctrl-F5 or F6. I have to cancel the build and then the next build works as expected. If I make another source change again the build hangs and has to be canceled.

The environment is Win 10 X64"

The response that I received was

"Van Kichline [MSFT] on 8/16/2018
Thank you for your feedback.Currently Blazor is in an experimental phase and is only accepting issue reports on the GitHub issue tracker at https://github.com/aspnet/Blazor/issues . Thanks!"

The issue was better defined by @uwefms in #15677 as being caused by starting the build with changed files.

@rynowak
Copy link
Member

rynowak commented Aug 16, 2018

Hi @MarkStega - could you try the fix suggested here: https://github.com/aspnet/Blazor/issues/1019#issuecomment-398497792?

@MarkStega
Copy link
Author

@rynowak
I tried both the aspnet/Blazor#1019 fix as well as the one suggested further down in the original issue as

    <!-- see https://github.com/aspnet/Razor/issues/2406 -->
    <UseRazorBuildServer>false</UseRazorBuildServer>
    <_RazorBuildServerPipeName>razor-issues-2406</_RazorBuildServerPipeName>

This doesn't seem to be the issue as I waited over 10 minutes on the hung build after making the change to the csproj.

@MarkStega
Copy link
Author

Although my issue didn't appear until I upgrade to VS 15.8.0 I wonder if it is related to #5566 ?

@LuohuaRain
Copy link

I have the same problem. After I upgrade my VS from 15.7.6 to 15.8, and sometimes VS will hang when compiling.

@neerajbharti
Copy link

neerajbharti commented Aug 17, 2018 via email

@paulbradbury
Copy link

+1 for hanging when compiling and the non-preview released 15.8.0. Above change doesn't to address it...

@uwefms
Copy link

uwefms commented Aug 17, 2018

Saving before compiling did the job for me

@MarkStega
Copy link
Author

@uwefms Yes, saving first does work but that is pretty lame after years of just doing a ctrl-f5 or f6 after making changes. I am finding that I start the build some 50% of the time forgetting to do the save first...

@JoelW187
Copy link

I had the same problem -- it always hung after the "restoring" message. I seem to have resolved the problem by turning off NuGet auto-download: Tools -> Options -> NuGet Package Manager, un-tick "Allow NuGet to download missing packages". I did this yesterday and I haven't seen the lockup once since then.

@MarkStega
Copy link
Author

@JoelW187
I tried your configuration change and the first build that I did with changed source files (ie, no save all before the build) hung...

@JoelW187
Copy link

@MarkStega
Hmmm... Sorry to hear that. I just tried setting my NuGet option back to ticked to see what happens. The odd thing is that yesterday, right after updating to 15.8.0, I seemed to always be getting the "Restoring" message when I built. Now I'm not seeing that message. I'll keep an eye on it and report any relevant observations.

@rynowak
Copy link
Member

rynowak commented Aug 17, 2018

A few questions for those experiencing these issues:

  1. Is this limited to Blazor projects - are you having problems with other .NET Core project types?
    1a. Does the problem occur at the command line or only in VS?
  2. When the build is 'hanging' is the CPU usage of VS low or high?

Could one of you experiencing this problem collect a memory dump for us to look at?

  1. Reproduce the failure
  2. Open a second VS windows and Debug->Attach to Process to the slow VS instance
  3. Break All in ebugger
  4. Debug ->Save Dump As...

Then upload somewhere we get at it (onedrive, google drive)

@MarkStega
Copy link
Author

  1. I created an ASP.Net Core API project and it does not repro the issue
    1a) The build runs from command line but since the error seems to be triggered by having a changed file open in VS when you start a build I'm not certain if that helps.
  2. low

Mem dump at

git clone https://MarkStegaOHI@bitbucket.org/MarkStegaOHI/blazorvsmemdump.git

@rynowak
Copy link
Member

rynowak commented Aug 20, 2018

Thanks, I'll take a look.

@rynowak
Copy link
Member

rynowak commented Aug 20, 2018

@MarkStega One other question - when this happens to you does VS prompt you to save the changed files?

@ransagy
Copy link

ransagy commented Aug 20, 2018

I think i came across the same thing now in a new blazor project - It didn't seem to happen to me on my existing project that i started back in 0.3.0 but that's probably just a fluke.

@rynowak At least in my case it didn't prompt.

@MarkStega
Copy link
Author

@rynowak No prompt (I've never has VS prompt me to save files before a build, it just saves them & does the build, probably a setting but in a quick look I don't see it).

@rynowak
Copy link
Member

rynowak commented Aug 20, 2018

We've been able to dig into this a bit more and looks like a core VS issue that's easy to hit with Blazor. Thanks everyone for your patience with this so far.

If you're bothered by this, you might be able to work around the problem by unchecking Automatically check for missing packages....

image

@ransagy
Copy link

ransagy commented Aug 20, 2018

Huh. Now that you mention it, i did recall seeing the restore messages in the status bar for a moment, but didn't link it to this. Good to know. @JoelW187 mentioned this as well. https://github.com/aspnet/Blazor/issues/1326#issuecomment-413864960

@StingyJack
Copy link

I found that cancelling the build, killing all dotnet.exe, msbuild.exe, and vbcscompiler.exe instances in task manager would permit me to Clean the solution and then build it. None of those appeared to be doing any work, it almost looks like VS lost connection to those child processes.

@SteveSandersonMS
Copy link
Member

@rynowak I've been getting this too and your workaround does fix it for me. Do you know if/when VS expects to fix the underlying issue?

@rynowak
Copy link
Member

rynowak commented Sep 25, 2018

Let me ask what happened to this, it got handed off to one of the VS teams to deal with..

@rynowak
Copy link
Member

rynowak commented Sep 28, 2018

This will be fixed in 15.9 - I'm not sure if the current public preview has the fix or not.

@MarkStega
Copy link
Author

MarkStega commented Oct 5, 2018

I had applied the workaround back in August and it seemed to be fine. The last several days I am again seeing the hung build. I checked and the workaround setting is still in place. It may be coincidental but I wasn't seeing this until after I upgraded to 0.6.0

New memory dump at

git clone https://MarkStegaOHI@bitbucket.org/MarkStegaOHI/blazorvsmemdump.git

@danroth27
Copy link
Member

This issue should now be fixed in Visual Studio 15.9 Preview 3: https://visualstudio.com/preview

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests