0

I have been trying to get Nuke to work for some time now, but am failing.

I installed the GlobalTools as follows:

dotnet tool install Nuke.GlobalTool --global

And then ran the setup in the solution directory:

nuke :setup

So far, so good. When I run nuke, everything works.

But now I want to fill the targets, e.g. the Restore Target with "DotNetRestore":

private Target Restore => _ => _
    .Executes(() =>
    {
        DotNetRestore(_ => _.SetProjectFile(Solution));
    });

The issue is, Visual Studio underlines "DotNetRestore" red to me, with the message

The name 'DotNetRestore' does not exist in the current context

Also, when I run "nuke", the following error message appears:

C:\Users\domin\source\repos\ConsoleApp4\build\Build.cs(29,13): error CS0103: The name 'DotNetRestore' does not exist in the current context [C:\Users\domin\source\repos\ConsoleApp4\build_build.csproj].

Can anyone tell me what I am doing wrong or what I am missing? I have tested it with a solution in which projects with .NET 6 are present, as well as with a completely new solution, console program with .NET Framework 4.8.

Update:

OS I'm trying to run it: Windows 10 and Windows 11, if that matters

Ken White
  • 123,280
  • 14
  • 225
  • 444
CaptTaifun
  • 321
  • 5
  • 15
  • Someone already answered this: https://stackoverflow.com/questions/74281592/how-to-find-and-use-methods-for-dotnetrestore-dotnetbuild-etc-in-nuke-build-6-2 – Samuel Munoz Feb 24 '23 at 00:53

0 Answers0