question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web Application build error with net6.0 framework, Failed to sign apphost with error code 0

See original GitHub issue

Web Application build error with net6.0 framework.

I am working on MAC and dotnet core 3.1, 5.0 and 6.0 versions are installed on my machine. I not able to build Web Application on my machine due to shared error in this ticket.

I can build web application in target framework net5.0 but not with net6.0 and console, class library projects’ build successfully. I tried to build using command line, VS 2022/2019 but no success.

Project file code as below and this is empty Web API project.

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.5" />
  </ItemGroup>

</Project>

To Reproduce

Exceptions (if any)

/usr/local/share/dotnet/sdk/6.0.100-rc.2.21505.57/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(5,5): Error NETSDK1177: Failed to sign apphost with error code 0: /Users/ajandersingh/Projects/WebAppTest/WebAppTest/obj/Debug/net6.0/apphost: is already signed (NETSDK1177) (WebAppTest)

Further technical details

image

  • Include the output of dotnet --info
  • VS 2022 Preview and VS 2019

Please assist to resolve code build error. I apologies if I have posted issue is not relevant to reported category

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:33 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
shockliangcommented, Jan 28, 2022

sudo xcode-select -r fixing the issue for me…

1reaction
iHaveBecomeDeathcommented, May 5, 2022

I had this problem today, where it failed to sign apphost since it is already signed. It resolved itself and disappeared once I had installed the latest .Net SDK (6.0.202).

I started by trying out the other suggestions, with xcode etc, but this fixed in the end.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Application build error with net6.0 framework, is ...
One workaround is to disable code signing. This is slightly better than disabling the app host creation completely.
Read more >
Breaking change: Generate apphost for macOS - .NET
Learn about the breaking change in .NET 6 where an executable is generated by default when building on macOS.
Read more >
Running a .NET 5 project on macOS M1 with .NET 6 leads ...
Failed to load /usr/local/share/dotnet/host/fxr/7.0.0-alpha.1.21425.4/libhostfxr.dylib, error: dlopen(/usr/local/share/dotnet/host/fxr/7.0.
Read more >
NET SDK error list - .NET CLI
A complete list of NETSDKxxxx errors, with links to more info where more ... NETSDK1177, Failed to sign apphost with error code {1}:...
Read more >
Unable to resolve AppHost for the current runtime if it's not ...
It seems like the issue is that the app host package could not be found in ".dotnet\x64\packs\runtime.win-x64.Microsoft.NETCore.DotNetAppHost" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found