-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The "CreateAppHost" task failed unexpectedly. (Version 16.4.5) #10708
Comments
curious... Are you running multiple VS instances or VS Code. Anything in that manner? Also, have you tried running Visual Studio in Administrator (ADMIN) mode? "Run as Administrator" |
Well, it does seem a Win32 File Lock may be the cause. Apart from the 'why' concern, sdk/src/Tasks/Microsoft.NET.Build.Tasks/CreateAppHost.cs Lines 83 to 84 in a5f5bb5
Indicates the exception handling should be replaced once dotnet/core-setup#7665 was merged, is that something that should be done? is capturing the |
Hi. I think only one instance of vs2019 is running. I use to kill the docker containers to solve this issue. Vs code is running react project in the background from a different folder. |
@brcaswell Maybe it is not so related to docker or 2 startup projects... Actually now, vs has become almost in-usable. I need to clean rebuild almost every debug... |
@brcaswell Can you please help with this issue??? I'm dying here... |
Same here. Using net core 3.1, single or multiple VS instance(s) makes no different, running on localhost:5000. Very random, it happens on rebuild, run and and I've seen it happening on IIS once published. I could run/debug the api for a half a day with no problem, then it happens again. |
@marekpetak I think it is starting when you stop and after very very short time debug again. then, after that point, it becomes very random... very hard to work like that |
This is a dup of dotnet/runtime#3832. This fix is approved for servicing: dotnet/core-setup#9012 |
CC: @wli3 @nguerrera |
The problem persists with latest SDK |
For me, cleaning the solution in VS 2019 16.4.5 and SDK 3.1.101 fixed this build error. |
For me it happens also in command line. And I love command line. |
Thank you! i had both things you mentioned going for me, i closed one of the instances (in a different IDE i was trying out) then i ran as admin and it finally worked! |
I can almost recreate this problem.
repeat and it will always crash first time, on 2nd time OK. |
This is a nightmare... nothing helps |
Running into this issue a lot as wel.. Just running a simple project with 2 docker containers, the docker-compose is my startup and it is the only VS2019 instance running. What helps me is just to clean to solution, after that I can debug untill it occurs again. |
Called corporate IT... They added an exception on the antivirus on my dev folder. Problem solved |
That's a workaround, not a resolution, @AlbertoBN . I tried to do the same, but the specific Trend Micro product installed on my machine explicitly doesn't support wildcards on exclusion paths, so I ended up having them completely disable TM. Now I'm stuck without a working antivirus. In the end, a code build process should not be hindered by antivirus. exclusions aside. We can blame the AV vendors, but I don't recall having this problem with any .NET build component in the last 18 years I've been using .NET. |
The fix to perform more retries on the AppHost update will be in 3.1.4, scheduled for next week. |
True. It is a workaround... And out of a team of 7 it happens to me only on a brand new laptop. However by the time the next version comes out and by the time we get to install it this is the best option for me. |
I had the same issue as well. Moving the solution folder into a folder not checked by the windows antivirus solve the issue. |
This is happening on Linux as well, when attempting to run |
@swaroop-sridhar the fix is not working. |
@avifatal to confirm:
As for workarounds, you can try disabling interference from other programs from locking the host when the build is in progress -- for example, whitelisting the executable you are building with anti-virus scanners. |
Updated VS to latest release and allowed my dll thru windows defender as a workaround. |
@swaroop-sridhar ok. no matter what update I made it is still happening. the one thing that helped is updating visual studio to the most recent: 16.6.0 |
I got it too |
Cleaning the solution fixed this for me. |
Solved it upgrading to VS 16.6.0, I never had it again |
Sill having this issue, I'm at VS 16.6.2. Any further resolution? |
@chendricks16 can you please add a few more details to your failure?
|
We had a similar issue and it was due to having simultaneously accessing the working folder in WSL and windows. This seemed to cause a locking problem and exhibited with this error. |
Same here. This issue for me was caused by WSL locking. I had to shutdown WSL completely to have it working, and in addition I observed (not measured) that the speed of VS 2019 is way better with WSL shutdown. |
Closing VS Code (running on WSL) solved the issue for me. Also worth mentioning that both VS and VS Code were using the same working dir |
Me too! |
Thanks everyone for contributing your scenarios, experience and workarounds to this issue; This particular issue was in the context of 16.4.5 and an earlier dotnetcore SDK. It was (has been) designated to be closed as a duplicate. That duplicate, original issue facilitated work on the retry logic that directly affects the reproducibility of this issue, and has been since released. Given that OP did indicate the issue was resolved with 16.6.0 version, I wouldn't expect reproducibility by the originator of this issue. As such, I think any subsequent issue and observation should be new on the basis of having the new functionality in place and with reproducibility. So, If you are experiencing this exception and issue on 16.6.X or later, please create a new issue workitem - feel free to link to this closed issue. |
Hi there, |
I created a SignalR (but otherwise pretty much blank-slate) web app in VS 16.8.2 with linux-docker checked as an empty project option, build the nearly empty solution with no issues and attach a debugger on Startup.cs. I then decide to detach the debugger ("stop debugging") and rebuild. It gave me a permission denied error, so I went in and manually killed and removed the pertaining docker images. Rebuilding after doing that is creating the following stack trace 1>C:\Program Files\dotnet\sdk\5.0.103\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(460,5): error MSB4018: The "CreateAppHost" task failed unexpectedly. Restarting my computer seems to fix the issue. But that's hardly a good solution since I'm frequently debugging. Not sure what's going on with docker, but it seems to be the culprit in this scenario. I'm updating VS to see if this resolves it. edit: Updated. Also made a new blank project w/o docker. Issue is now persisting even after a restart. Have no idea what's going on. It's very strange. I will try .netcore3.0 and see what's up. edit edit: IT admin reached out. I was flagged for anti-virus on apphost.exe, that explains it. So it's the same issue. (webroot antivirus) |
What fixed for me was deleting all This was caused by using VSCode as admin. Apparently after I build solution with VSCode as admin, some gets messed up resulting with this issue. |
Hi,
Microsoft Visual Studio Community 2019
Version 16.4.5
Randomly getting the bellow error. I have added my root folder to the antivirus exclusion list.
Thanks
The text was updated successfully, but these errors were encountered: