Skip to content

project.assets.json' doesn't have a target for '.NETStandard,Version=v2.0' #7334

@andriysavin

Description

@andriysavin

I have a .Net Core console app which targets net471, and references a netstandard2.0 library project. I'm trying to publish it to an Azure WebJob using VS Publish command from project context menu, and getting error like this after publish starts:

C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error NETSDK1005: Assets file 'C:\Code\Temp\TestAzureDeployBug\ClassLibrary\obj\project.assets.json' doesn't have a target for '.NETStandard,Version=v2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project. [C:\Code\Temp\TestAzureDeployBug\ClassLibrary\ClassLibrary.csproj]

If I change target framework to netcoreapp2.1 the error doesn't happen.

NuGet version: 4.6.0
dotnet.exe --version: 2.1.402
VS version (if appropriate): 15.8.5
OS version (i.e. win10 v1607 (14393.321)): win10 1803

Link to the sample project: https://1drv.ms/u/s!AuaAKPMkiTEAxrB3CJOUHMFvz2cq2Q
Note that I removed publish profile, and you need to create one for you Azure AppService.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions