-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Randomly get 'The "CreateAppHost" task failed unexpectedly' error when doing CLI build of a new web app #3831
Comments
From @livarcocc on Thursday, June 27, 2019 7:50:20 PM @peterhuene can you take a look? |
From @peterhuene on Thursday, June 27, 2019 7:52:13 PM 0x8007006E is cannot open the file specified. Not entirely sure if that's because it doesn't exist or a sharing violation. My guess would be on the latter since it's intermittent (perhaps something external to the build is interfering?). |
From @peterhuene on Thursday, June 27, 2019 7:53:35 PM We have a lot of tests that create and customize the apphost on Windows and I haven't seen flaky CI with this. I'll attempt to repro it. |
From @livarcocc on Thursday, June 27, 2019 7:57:45 PM Anti-virus? |
From @peterhuene on Thursday, June 27, 2019 10:00:29 PM I ran @DamianEdwards are you seeing this on a particular machine or multiple machines? |
From @DamianEdwards on Friday, June 28, 2019 8:12:37 PM @peterhuene was seeing this on only one machine so far, but haven't tried to repro it on my other machine. |
From @peterhuene on Monday, July 15, 2019 10:52:15 PM @DamianEdwards I'm still not able to reproduce this. The API call is As I don't have any MSIT-controlled Windows machines (and it's been a decade since I last did), I don't know what we're using for antivirus on corpnet these days. Would it be possible to check if its the real-time protection of the antivirus software that's interfering with the build? |
From @peterhuene on Friday, July 26, 2019 7:22:42 PM I'm updating the |
From @wli3 on Thursday, August 1, 2019 10:17:07 PM I have a repro too during app building on blazor server app, but not consistent. I ran
|
From @peterhuene on Thursday, August 1, 2019 10:27:04 PM Would it be possible to use procmon to see if we can figure out who is opening the file? I've never been able to reproduce the issue in a VM. |
From @wli3 on Thursday, August 1, 2019 10:40:45 PM good point, let me try several times more |
From @peterhuene on Tuesday, August 6, 2019 6:31:04 PM For preview 9, we'll retry the apphost creation as a mitigation for these file locking issues. I'm going to leave this issue open for now to see if we can get some idea of which external process is locking the apphost. |
From @wli3 on Wednesday, August 7, 2019 6:36:16 PM Spend another half of an hour trying to repro, see once again, but forget to open procmon :( start to think it is anti virus scan -- once it is scanned once, it no longer does that anymore. |
From @swaroop-sridhar on Saturday, August 10, 2019 12:12:58 AM @peterhuene I looked a bit more at the ResourceUpdater code in HostModel -- wrt whether/where retries should be added to ResouceUpdater code. Looks like there are only two places where a file is opened: Both the above functions take in a path and obtain a In particular, in the callstack described above, we see that the So, I don't think adding retries is the correct fix in this case. |
From @swaroop-sridhar on Saturday, August 10, 2019 12:26:21 AM There is one scenario I can see where we may end up in this case: If we call The |
From @swaroop-sridhar on Saturday, August 10, 2019 1:03:43 AM The error codes for lock-violation is |
From @swaroop-sridhar on Saturday, August 10, 2019 2:41:53 AM @peterhuene @wli3 |
From @nguerrera on Monday, August 12, 2019 6:52:45 PM Reopened based on discussion above suggesting there's still something else here |
From @UweKeim on Thursday, August 22, 2019 1:32:33 PM I'm getting this/a similar error with an ASP.NET Core 3 Preview-7 project, when I first opened it with Preview-8 in Visual Studio 2019: 1>------ Rebuild All started: Project: TechmemeRiver, Configuration: Release Any CPU ------
1>You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
1>
1>Bundler: Cleaning output from bundleconfig.json
1>Bundler: Done cleaning output file from bundleconfig.json
1>
1>Bundler: Begin processing bundleconfig.json
1> Minified wwwroot/css/site.min.css
1> Minified wwwroot/js/site.min.js
1>Bundler: Done processing bundleconfig.json
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: The "CreateAppHost" task failed unexpectedly.
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: Microsoft.NET.HostModel.ResourceUpdater+HResultException: 80070005
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.NET.HostModel.ResourceUpdater.Update()
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String assemblyToCopyResorcesFrom)
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore() in /_/src/Tasks/Microsoft.NET.Build.Tasks/CreateAppHost.cs:line 35
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 47
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(359,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "TechmemeRiver.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== Edit 1: After doing a "Clean" and "Rebuild", the error does not occur anymore: 1>------ Rebuild All started: Project: TechmemeRiver, Configuration: Release Any CPU ------
1>You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
1>
1>Bundler: Cleaning output from bundleconfig.json
1>Bundler: Done cleaning output file from bundleconfig.json
1>
1>Bundler: Begin processing bundleconfig.json
1> Minified wwwroot/css/site.min.css
1> Minified wwwroot/js/site.min.js
1>Bundler: Done processing bundleconfig.json
1>TechmemeRiver -> E:\Dropbox\Beruf\Prog\TechmemeRiver\Source\TechmemeRiver\bin\Release\netcoreapp3.0\TechmemeRiver.dll
1>TechmemeRiver -> E:\Dropbox\Beruf\Prog\TechmemeRiver\Source\TechmemeRiver\bin\Release\netcoreapp3.0\TechmemeRiver.Views.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== I hope, it stays this way. |
From @livarcocc on Thursday, August 22, 2019 5:39:08 PM @peterhuene any ideas? |
From @peterhuene on Thursday, August 22, 2019 7:27:08 PM No new theories other than something like an antivirus program is interfering with writing out the resources. I've been unable to reproduce at all, but I don't use any such programs that might interfere in this manner. The above is a generic access denied error. I still believe that retry at the point of resource updater interaction in Ultimately I hope a future version of the SDK opens the apphost just once for customization, but that would require getting rid of the resource API usage (something we want to do to increase supported platforms for the operation anyway). |
From @Kurira on Saturday, September 28, 2019 6:15:41 AM This still happens randomly on release bits. Usually on build either through vs or if dotnet tool tries to compile assembly. Never happened twice in a row though. |
From @charsleysa on Sunday, September 29, 2019 5:53:02 AM @peterhuene maybe this has something to do with WSL? I found that if I have the project folder open in VSCode through WSL (no files open, just the project folder loaded in VSCode) then this error occurs, though I experience this error through Visual Studio not the CLI. To get around this issue I close VSCode, wait a few seconds, run the compilation, then re-open VSCode. This allows it to compile just fine. |
From @wli3 on Sunday, September 29, 2019 8:17:56 PM @charsleysa i'll continue work on this issue. Are you using the 3.0.100 SDK? |
From @charsleysa on Sunday, September 29, 2019 9:07:40 PM @wli3 yes, I'm using the 3.0.100 SDK that is installed alongside Visual Studio 2019 16.3.1 |
From @SirUppyPancakes on Tuesday, October 1, 2019 7:16:41 AM I also see the error in Visual Studio 2019 16.3.1 (3.0.100 SDK) when doing
The solution I'm building is made up of three projects:
The error occurs every third or so attempt and only seems to manifest on the NET Core 3.0 WPF Application build (and not on the core libraries). Sometimes it'll be on the I also tried disabling parallel builds by setting the maximum parallel builds in My computer configuration is also pretty bare bones, running Windows 10 with the latest updates, no major telemetry programs or real-time antivirus running. |
From @TEnigma on Wednesday, October 2, 2019 9:37:09 AM I just had the same thing on our buildserver (Windows Server 2016) with SDK 3.0.100 and I think for us the problem was that the path of the generated files are to long. Can it be? But I had other HResultException: 8007007A I copied the folder to a shorter path and then the build worked. |
From @ooXei1sh on Sunday, October 6, 2019 4:12:13 AM Similar exception seen using VSCode with Closing and reopening VSCode would fixed temporarily. Disconnecting from WSL Ubuntu from VSCode menu on bottom left of UI. Maybe related ticket, but just moving to ~ path didn't work for me: dotnet/core#3444 After disconnecting WSL: Ubuntu remote connection, |
From @conkman on Thursday, October 10, 2019 12:29:28 PM I am also running into this on our Dotnet core 2.2 project. It is very intermittent. Has a root cause been found yet? |
From @garethblz on Monday, October 28, 2019 6:27:28 PM I also reproduced the issue on netcoreapp 3.0.100 in Visual Studio 2019 16.3.9. Simple ASP.NET Core project on the IIS Express profile. The only external dependencies are on StyleCop.Analyzers 1.1.118. Would be interested to know if anyone else experienced this with the same dependencies. Here's the error (looks the same as what's reported).
|
https://github.com/dotnet/sdk/issues/3863 was transferred to core-setup as https://github.com/dotnet/core-setup/issues/8776. So we no longer need this issue. |
Is it just me or all these issues are closed now? One should be still open, right? |
@nightroman dotnet/core-setup#8776 is open .. sorry for the confusion with the two issues. |
I got same issue with "Clean" and "Rebuild", it worked fine. but it is very annoying. |
what is this file (C:\Program Files\dotnet\sdk\3.1.100-preview1-014459\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets) for? BTW, I use .net core 3.0 to build my asp.net core app not 3.1.1. In case, it helps. |
@baoshenyi could you comment on https://github.com/dotnet/core-setup/issues/8776 this issue is moved to that one |
In my case, the issue is fixed if i switch to Release, on Debug is still happening :( |
I get the same exception while building Web Project. Any fix? |
i also get this exception with .net core 3.1. it stops the whole CI |
@fitimdurmishi @tomasr78 @ghbeta could you comment on https://github.com/dotnet/core-setup/issues/8776 ? This thread is no monitored |
@wli3 You better monitor this thread as it's the first position in google on "createapphost task failed unexpectedly". |
I've just did File->New Project -> WebApi in visual studion 2019 with .net core 3.1. and got the same error. It went away after Clean and Rebuild but it's not a great experience :( |
I've encountered this same issue doing a build on a .NET Core Worker Service with Docker compatibility in VS2019 on Windows 10. Error below:
|
Seems mine is not so much random, as every time I try to build :/ I don't know how to fix it. |
I just turned off Windows anti-virus real time protection, did a build again - this time no error. So whoever mentioned Anti Virus earlier in this thread is probably onto something. |
Locking to direct new posts to #3832 |
That's closed too. @wli3 is there an active issue here? |
@danmosemsft i think #3832 should be the right one. It is closed due to fix is merged. @swaroop-sridhar |
OK. I am still going to lock this in order to send any new comments there. |
This fix is expected to be in release 3.1.4 later this month. |
From @DamianEdwards on Thursday, June 27, 2019 7:48:16 PM
Steps to reproduce
dotnet new webapp
dotnet build
Expected behavior
No errors
Actual behavior
Randomly see the following error (twice in the last 20 builds just now):
Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#11650
The text was updated successfully, but these errors were encountered: