none
CreateAppHost Task Failed Unexpectedly RRS feed

  • Question

  • Just created a new Console Application project in C# and was not able to build it. Is there any way to fix this?

    I haven't even touched the code:

    using System;
    
    namespace Catan
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello World!");
            }
        }
    }

    Here is my stack trace:

    Error	MSB4018	The "CreateAppHost" task failed unexpectedly.
    Microsoft.NET.HostModel.HResultException: 80070013
       at Microsoft.NET.HostModel.AppHost.HostWriter.<>c__DisplayClass2_0.<CreateAppHost>g__UpdateResources|1()
       at Microsoft.NET.HostModel.RetryUtil.RetryOnWin32Error(Action func)
       at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String assemblyToCopyResorcesFrom)
       at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore()
       at Microsoft.NET.Build.Tasks.TaskBase.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	Project	C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets	370		


    • Edited by FrozenLion Thursday, November 21, 2019 1:13 AM
    Thursday, November 21, 2019 1:12 AM

All replies

  • Hi FrozenLion,

    Welcome to MSDN forum.

    According to your description, did you install some extensions for visual studio? Not sure if they will modify the csproj file, we recommend you could run visual studio in safe mode, then re-create a new console application to check if it could build.

    Note: safe mode -> open developer command prompt, then type "devenv /safemode".

    And if it persists, please open csproj file using notepad, then share the context here, which could help us analysis this issue better.

    Look forward to your feedback.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, November 21, 2019 7:21 AM
  • Hi FrozenLion,

    Did you follow Dylan's advice to troubleshoot your issue? Also, the detailed information as he said is necessary.

    Since the issue is more complex to explain, you can try these steps:

     1. change the framework target of your project to net core 2.1 and  build. After that, change it back to net core3.0 to check whether the issue perists.

     2. try to disable Windows Defender Antivirus real-time protection in case the this mechanism interferes with the construction of the project.

     3. delete  the bin and obj folder and rebuild your project multiple times.

    >>Hint from here.

    If the issue still persists, please feel free to let us know and we are willing to help you further.

    Best Regards,

    Perry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Tuesday, November 26, 2019 8:32 AM