Restore/Publish .NET Core 2.0 app
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,
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
Support Staff 1 Posted by Owen McDonnell on 31 Oct, 2018 12:07 AM
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 Posted by kosunix on 31 Oct, 2018 09:15 AM
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?
Support Staff 3 Posted by Owen McDonnell on 02 Nov, 2018 01:07 AM
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 Posted by kosunix on 02 Nov, 2018 09:52 AM
Thank you, for clarification.
Owen McDonnell closed this discussion on 02 Nov, 2018 02:34 PM.