dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.96k stars 4.91k forks source link

Installation Guidance #3674

Open StevenElTaino opened 5 years ago

StevenElTaino commented 5 years ago

Installation Guidance Missing

No guidance on whether installation requires a reboot, or restart of services. No guidance on silent installation.

General

Trying to determine how to deploy this software using a configuration management tool, if there are command line options and whether restart of server/services is required.

Please provide a code sample for your issue if it is relevant, either inline, link to a gist (or similar) or add it as a zipped attachment.

For some issues, you will get a quicker and better response if you file it at a more specific .NET repo. For example, if the problem is with ASP.NET Core, you are encouraged to use the aspnet/home repo.

scalablecory commented 5 years ago

Reboot should only be needed if the installer is replacing an in-use file, in which case you should get a prompt. There is a /quiet flag you can use to avoid displaying any prompts.

CC @dagood

dagood commented 5 years ago

Heads up that if you try to update the .NET Core Runtime, it will shut down FDE applications locking the old runtime without prompting. For FDD apps, it will raise a prompt due to the lock on dotnet.exe, but shut them down anyway due to the lock on the old runtime. More info at https://github.com/dotnet/core-setup/issues/8546.

The best way to handle it is to shut down running apps yourself, then run the update. It then won't require a reboot and won't unexpectedly shut anything down.


For initial install, a reboot is not required.

The install does add to PATH, so apps that are already running won't be able to find dotnet.exe using their old value of PATH. This is why you need to restart command lines before they can use dotnet commands.


You can run the exe with /? to see the full list of options (including /quiet).


@leecow, @MichaelSimons, @dleeapho, a doc does seem useful for update scenarios on service hosts. I see https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.0#install-the-net-core-hosting-bundle but it doesn't touch on details like this.

chadjefferies commented 4 years ago

The install does add to PATH, so apps that are already running won't be able to find dotnet.exe using their old value of PATH. This is why you need to restart command lines before they can use dotnet commands. I don't think you will run into this in a deployment scenario.

Could one potential issue here be the Windows Task Scheduler? I am not aware of a "simple" way to restart that and it would require the PATH variable to schedule any dotnet commands after initial install.

dagood commented 4 years ago

Could one potential issue here be the Windows Task Scheduler? I am not aware of a "simple" way to restart that

Apparently terminating Taskeng.exe will make it refresh the env vars it uses next time a scheduled task runs: https://superuser.com/a/527727. (Or even simpler, reboot the machine. 😄) A scenario where this is a problem isn't clear to me though, do you have one in mind?

chadjefferies commented 4 years ago

I recall in the past after initially installing net core on a machine that never had it, we didn't reboot the system as it wasn't required. Shortly after, we setup a scheduled task to run using dotnet ... and it failed. It took us a while to figure out that it had the environment variables cached out. We ended up fully qualifying the path to dotnet until we were able to reboot the system, at which point we switched it back to dotnet...

I wouldn't call this a "problem", but if any installation guidance documentation would be created, I figured I would mention this as a possible candidate to include in a Windows specific section.

dagood commented 4 years ago

Ah, yeah, that makes sense. Thanks for the detail. (Removed my "I don't think" note from the comment.)