Skip to content

Missing Restore target when building with Microsoft.Build #892

Open
@debanne

Description

@debanne

I'm trying to build a .NET Core csproj using directly the Microsoft.Build API. The attempt can be seen here:
https://github.com/debanne/dotnet-builder/blob/master/Builder/Program.cs
I know that there is no nuget providing the targets (until issue #300 is solved), so I configured the "MSBuildSDKsPath" environment variable as a workaround.

My problem is that MSBuild complains when building the "Restore" target with this message:

: ERROR C:\cygwin64\home\debanne\repos\testMSBuild\Builder\Builder\bin\Debug\resources\project1\CoreApp.csproj(0,0): The target "Restore" does not exist in the project.

The "Build" target works correctly though if I have run first a "dotnet restore".
I see the Restore target is present in dotnet/sdk/1.0.0-rc4-004771/Nuget.targets. Is there a way to make the Microsoft.Build API use it?

The full output is in attachment:
builder_log.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions