Restore/Publish .NET Core 2.0 app

kosunix's Avatar

kosunix

29 Oct, 2018 08:15 PM

Hi! Previously dotnet restore/publish commands were not related and executed separately. As a general practice we use dotnet restore on before_build step. But starting from .NET Core 2.0 based on doc from MS https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish?t... we can skip current step of restoring NuGet package because currently it included inside publish command. Is it good practice now if I omit using restore command on before_build step? Thank you,

  1. Support Staff 1 Posted by Owen McDonnell on 31 Oct, 2018 12:07 AM

    Owen McDonnell's Avatar

    I'm not sure how to answer the question of good practice, except to confirm that yes, packages will be implicitly restored before any dotnet command that requires it (which includes publish).

  2. 2 Posted by kosunix on 31 Oct, 2018 09:15 AM

    kosunix's Avatar

    Ok, let me to rephrase question. Is there any benefits/additional information from AppVeyour I can get now if I separate using those two commands? Does it add level of granularity to manage more precisely of publish .NET Core app?

  3. Support Staff 3 Posted by Owen McDonnell on 02 Nov, 2018 01:07 AM

    Owen McDonnell's Avatar

    In general, it's probably wise to use the latest tools and the simplest approach.
    I guess you could consider it beneficial if you separated commands in order to more quickly determine which one was failing, though it seems like a negligible benefit to me. Depending on the type of project you have, using nuget instead of dotnet cli may have more significant differences.

  4. 4 Posted by kosunix on 02 Nov, 2018 09:52 AM

    kosunix's Avatar

    Thank you, for clarification.

  5. Owen McDonnell closed this discussion on 02 Nov, 2018 02:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac