Skip to content

Commit 3ce09ca

Browse files
committed
Merge pull request dotnet#454 from cartermp/update-library-manual
add disclaimer for not using dotnet publish for NuGet packages
2 parents 11d2661 + 1e2baee commit 3ce09ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/core-concepts/libraries/libraries-with-cli.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ And that's it!
603603

604604
Imagine that you just wrote an awesome new library that you think other developers could use. You can create a NuGet package to do exactly that! It's quite easy with the .NET CLI. The following example assumes a library called **Lib** which targets `netstandard1.0`.
605605

606-
> **Note** If you have transitive dependencies; that is, a project which depends on another project, you'll need to make sure to restore packages for your entire solution.
606+
> If you have transitive dependencies; that is, a project which depends on another project, you'll need to make sure to restore packages for your entire solution.
607607
608608
After ensuring packages are restored, you can navigate to the directory where a library lives:
609609

@@ -623,7 +623,11 @@ Lib.1.0.0.nupkg
623623
Lib.1.0.0.symbols.nupkg
624624
```
625625

626-
And now you have the necessary files to publish a NuGet package! If you want to build a NuGet package with release mode binaries, all you need to do is add the `-c`/`--configuration` switch and use `release` as the argument.
626+
And now you have the necessary files to publish a NuGet package!
627+
628+
> For .NET Core RC2, libraries are expected to be distributed as NuGet packages. This can only be done with `dotnet pack` when using the .NET CLI. It is important that you use `dotnet pack` instead of `dotnet publish` for this. Using `dotnet publish` for a library will error out.
629+
630+
If you want to build a NuGet package with release mode binaries, all you need to do is add the `-c`/`--configuration` switch and use `release` as the argument.
627631

628632
`$ dotnet pack --configuration release`
629633

0 commit comments

Comments
 (0)