aspnetcore: Error NETSDK1047: Assets file 'project.assets.json' doesn't have a target for '.NETCoreApp,Version=v5.0/linux-x64'.

I have an automated build pipeline in Azure DevOps and since I updated my project to .NET Preview 7 it throws this error during the build phase. Before this step a restore is successfully completed. My project file already has framwork and runtime identifiers defined as shown:

<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifiers>win-x86;win-x64;win-arm;linux-x64;linux-arm</RuntimeIdentifiers>

The pipeline passed during Preview 6 with no other changes made to the project.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (6 by maintainers)

Most upvoted comments

What should I do to get Azure DevOps to build the project?

Oh, wait, never mind, I was looking at the wrong build. It passed.

@pranavkm can you please make sure this is addressed in 5.0, if not already? Thanks!

I receive the same error when publishing my server project that references a Blazor wasm client project.

- task: DotNetCoreCLI@2
  displayName: 'Publish App'
  inputs:
    command: 'publish'
    publishWebProjects: false
    projects: '**/Maki.Server.csproj'
    arguments: '--configuration $(BuildConfiguration) --runtime win-x64 --self-contained true --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: true

In DevOps:

C:\hostedtoolcache\windows\dotnet\sdk\5.0.100-preview.7.20366.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1047: Assets file 'd:\a\1\s\src\Maki.Client\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v5.0/browser-wasm'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project. You may also need to include 'browser-wasm' in your project's RuntimeIdentifiers. [d:\a\1\s\src\Maki.Client\Maki.Client.csproj]

@BrunoBlanes this might be a bug in the product. The above comment is to help us to investigate