Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Why dotnet build failing and how to fix it? #4373


User avatar
0
manojreddy created

Running dotnet build from the command prompt and getting an error.

Welcome to .NET Core!

Learn more about .NET Core @ <a class="postlink" href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a>. Use dotnet --help to see available commands or go to <a class="postlink" href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.

Telemetry

The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry @ <a class="postlink" href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>. Microsoft (R) Build Engine version 15.5.179.9764 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.

C:\Users\MyName\source\repos\MyProject\aspnet-core\src\MyCompany.MyProject.Core\MyCompany.MyProject.Core.csproj : error NU1003: PackageTargetFallback and AssetTargetFallback cannot be used together. Remove PackageTargetFallback(deprecated) references from the project environment. [C:\Users\MyName\source\repos\MyProject\aspnet-core\MyCompany.MyProject.sln]

Build FAILED.

C:\Users\MyName\source\repos\MyProject\aspnet-core\src\MyCompany.MyProject.Core\MyCompany.MyProject.Core.csproj : error NU1003: PackageTargetFallback and AssetTargetFallback cannot be used together. Remove PackageTargetFallback(deprecated) references from the project environment. [C:\Users\MyName\source\repos\MyProject\aspnet-core\MyCompany.MyProject.sln] 0 Warning(s) 1 Error(s)

Time Elapsed 00:00:04.73


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    The answer is right there:

    Remove PackageTargetFallback(deprecated) references from the project environment.

  • User Avatar
    0
    manojreddy created

    Thanks @aaron,

    It worked :)