"Error MSB4057 with missing target package" when creating .netstandard nuget package

I am trying to create a .netstandard nuget package following these instructions using VS2017 RC. It builds fine, but when I try to create a package using

msbuild /t:pack /p:Configuration=Release

I get an error that the “target package” is not available in my solution: (sorry for German)

error MSB4057: Das Ziel "pack" ist im Projekt nicht vorhanden.

I am not sure what to do with this message or where I should look for it. Any suggestions?

+4
source share
3 answers

Thanks to the answer to

, NuGet.Build.Tasks.Pack NuGet.

+8

msbuild /t:pack /p:Configuration=Release , MSBuild pack script. , MSBuild script ( ). ? script <import>.

0

You must import goals before using them. In the project file before using the goals, write:

  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
0
source

Source: https://habr.com/ru/post/1663129/


All Articles