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) #1326

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

Comments

Projects
None yet
@MarkStega
Copy link

MarkStega commented Aug 16, 2018

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 #1323 as being caused by starting the build with changed files.

@rynowak

This comment has been minimized.

Copy link
Member

rynowak commented Aug 16, 2018

Hi @MarkStega - could you try the fix suggested here: #1019 (comment)?

@MarkStega

This comment has been minimized.

Copy link

MarkStega commented Aug 16, 2018

@rynowak
I tried both the #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

This comment has been minimized.

Copy link

MarkStega commented Aug 16, 2018

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

@LuohuaRain

This comment has been minimized.

Copy link

LuohuaRain commented Aug 17, 2018

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

This comment has been minimized.

Copy link

neerajbharti commented Aug 17, 2018

@paulbradbury

This comment has been minimized.

Copy link

paulbradbury commented Aug 17, 2018

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

@uwefms

This comment has been minimized.

Copy link

uwefms commented Aug 17, 2018

Saving before compiling did the job for me

@MarkStega

This comment has been minimized.

Copy link

MarkStega commented Aug 17, 2018

@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

This comment has been minimized.

Copy link

JoelW187 commented Aug 17, 2018

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

This comment has been minimized.

Copy link

MarkStega commented Aug 17, 2018

@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

This comment has been minimized.

Copy link

JoelW187 commented Aug 17, 2018

@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

This comment has been minimized.

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

This comment has been minimized.

Copy link

MarkStega commented Aug 18, 2018

  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

This comment has been minimized.

Copy link
Member

rynowak commented Aug 20, 2018

Thanks, I'll take a look.

@rynowak

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

MarkStega commented Aug 20, 2018

@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

This comment has been minimized.

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

This comment has been minimized.

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. #1326 (comment)

@StingyJack

This comment has been minimized.

Copy link

StingyJack commented Sep 10, 2018

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

This comment has been minimized.

Copy link
Member

SteveSandersonMS commented Sep 25, 2018

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

danroth27 commented Oct 5, 2018

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

@danroth27 danroth27 closed this Oct 29, 2018

@danroth27 danroth27 added the external label Oct 29, 2018

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