NETSDK1085 when packing with `--no-build`
See original GitHub issueWhen 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)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:17 (4 by maintainers)
Top Results From Across the Web
.net core - Prevent `dotnet pack --no-build` from triggering a ...
Sdk.targets(133,5): error NETSDK1085: The 'NoBuild' property was set to true but the ... Pack all projects of the solution to NuGet packages.
Read more >Include both Nuget Package References and project ...
using dotnet pack to geneate a nuget package with project ... Sdk.targets(143,5): error NETSDK1085: The 'NoBuild' property was set to true ...
Read more >How to create asp.net webpublish package without ...
I'm trying to separate the build and packaging steps to sign the dll's before published. ... error NETSDK1085 : The 'NoBuild' property was...
Read more >NET SDK error list - .NET CLI
Run a NuGet package restore to generate this file. ... NETSDK1085, The 'NoBuild' property was set to true but the 'Build' target was...
Read more >dotnet pack passing the directory does not work
So, I want ot orun pack without a new build. The documentation for dotnet pack says:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Confirming this same issue for C# and a csproj file that references another project via project reference. I am running this with .NET 6.0 SDK in Azure DevOps using a DotNetCoreCLI@2 task and noticed the same behavior. Removing
nobuild: truefrom the inputs will work around the issue. The error from the log looks like the followingI was able to work around the issue by adding
/p:TargetsForTfmSpecificContentInPackage=to the build command to preventPackageFSharpDesignTimeToolsfrom being run. The package seems to contain the same as ifdotnet packis run without--no-build.