-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Intermittent error "Could not find build environment" #125
Comments
Thanks for the report. The error “Could not find build environment” typically happens in a couple specific cases:
The fact this is only happening intermittently though is interesting. Any idea if it’s always the same project that triggers the error? One thing I could do is make that clearer: “could not find build environment for someproject.csproj”. Are all the projects in the solution .NET Core or are there a mix of projects? It’s possible trying to make a bunch of |
No idea I'm afraid. I was actually removing projects expecting to find one of them was the cause but instead I just found a point where it worked intermittently.
I'll try and do that today.
Yes they are all .net core. The only unusual things that I will test today:
|
Great - thanks for following up. Let me know what you find. Both your thoughts about multi-targeting and Rider sounds plausible - or could be something totally different. To good news is that the problem does seem to be happening at the |
Quick note; I tried running with latest head and also the 2.5 version but I get a run-time exception about
|
Info so far:
|
The cause is a race condition between the I tried adding some synchronisation around the The solution is kind of insane. See the remarks at the bottom of here for the problem:
So the fix is to change public bool WaitForExit(int timeout) => Process.WaitForExit(timeout); to public bool WaitForExit(int timeout)
{
bool result = Process.WaitForExit(timeout);
Process.WaitForExit();
return result;
} I can confirm this works. |
Lol. That's...goofy. Thanks a bunch for running this to ground! Making the change now and will release momentarily. |
I think I probably have a lot of projects that need to be patched now :) |
Thanks @daveaglick much appreciated! |
2.5.1 rolling out now, should show up in NuGet in about 10 minutes (unless NuGet is slow indexing, which happens often) |
I am seeing intermittent failures of
GetWorkspace
. The frequency seems proportional to the number of projects in a solution:Given the parallelization in the stack trace, it might be relevant that I am on a 12 core machine.
Example test
Versions
Exception trace:
The text was updated successfully, but these errors were encountered: