Skip to content

NETSDK1085 when packing with --no-build #12320

Open
@iwillspeak

Description

@iwillspeak

When packing an F# project that depends on another project via ProjectReference a spurious Build is triggered on the base project. This triggers the SDK error NETSDK1085. It doesn't seem to matter if the project being referenced is an .fsproj or .csproj. In both cases the preojct being referenced will be re-built and trigger the error. Executables being packed as tools don't seem to trigger this behaviour.

dotnet new classlib --language F# --name eff -o eff
dotnet new classlib --language F# --name gee -o gee
dotnet add gee/gee.fsproj reference eff/eff.fsproj
dotnet build gee/gee.fsproj && dotnet pack gee/gee.fsproj --no-build

Expected behavior

The project should produce a NuGet package with no errors

Actual behavior

The error NETSDK1085 is reported:

/usr/lib64/dotnet/sdk/5.0.206/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(146,5): error NETSDK1085: The 'NoBuild' property was set to true but the 'Build' target was invoked. [/testing/Gee.fsproj]

Known workarounds

Don't provide the --no-build flag when packing.

Related information

  • Operating system: Fedora Linux 34
  • .NET Runtime kind .NET 5 (SDK 5.0.206)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ProjectsAndBuildMSBuild tasks, project files, framework resolutionBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions