Skip to content

The "JsonPeek" task was not found #86

@RobSmyth

Description

@RobSmyth

Describe the Bug

I'm unable to compile a project using JsonPeek. It fails with the error:

Error (active) MSB4036 The "JsonPeek" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64" directory.

Steps to Reproduce

In Visual Studio 2022:

  1. Create a new .net 8.0 C# assembly project.
  2. Add the NuGet package JsonPeek version 1.2.0 package to the project.
  3. In the csproj file add:
 <Target Name="PeekSimpleValue"
        BeforeTargets="Clean;Build;Pack;GenerateNuspec;SetTeamCityBuildLabel">

  <JsonPeek ContentPath="$(Git2SemVer_SharedVersioningPropsFile)" Empty="$empty" Query="$.InformationalVersion">
   <Output TaskParameter="Result" PropertyName="Git2SemVer_InformationalVersion" />
 </JsonPeek>

  <PropertyGroup>
   <InformationalVersion>$(Git2SemVer_InformationalVersion)</InformationalVersion>
  </PropertyGroup>

 </Target>
  1. Compile. The compile fails.

Expected Behavior

Compile without error.

Exception with Stack Trace

No exception. MSBuild error given above.

Version Info

1.2.0

Additional Info

It works, on Windows, if I add to the csproj:

 <UsingTask TaskName="JsonPeek" AssemblyFile="C:\Users\Robert\.nuget\packages\jsonpeek\1.2.0\build\JsonPeek.dll"/>

This fails if using dotnet CLI to build on linux.

This also fails:

 <UsingTask TaskName="JsonPeek" AssemblyFile="JsonPeek.dll"/>

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions