0

I am struggling to know if there any way to check for .NET versions.

On any given server, can we able to check if the following requirements are met? And if they are installed or not.

☐ Install IIS
☐ Install .NET Core Framework Runtime & Hosting Bundle [1.1]
☐ Install .NET Core Framework Runtime & Hosting Bundle [2.2] 
☐ Install .NET core 1.1 Runtime & Hosting Bundle for Windows (v1.1.13)
☐ Install .NET Standard Framework Runtime >= 4.7.1
☐ Install PowerShell >= 5
☐ Install Google Chrome

I have tried some of the code which I can check individually for some of the program. it gives me output if it installed, but i need the way to check all .NET related things here.

for IIS

reg query "HKLM\SOFTWARE\Microsoft\InetStp"  | findstr VersionString

for Powershell

powershell -command "(Get-Variable PSVersionTable -ValueOnly).PSVersion.Major"

for Chrome

reg query "HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon"
aschipfl
  • 33,626
  • 12
  • 54
  • 99
goldenbutter
  • 575
  • 2
  • 12
  • 25
  • .NET Core or .NET Old? You can check for .NET Core versions easily with `dotnet --version` or `dotnet --list-runtimes` – Panagiotis Kanavos Sep 08 '20 at 09:16
  • 1
    .NET Core 1.1 is no longer supported, so you shouldn't be using it at all. The current LTS (long-term support) versions are 2.1 and 3.1. Use 3.1 unless you have a real, very important reason to use the older version. .NET Core 2.2 is *NOT* an LTS version and *no longer supported*. It went out of support when the latest LTS version (3.1) was released. – Panagiotis Kanavos Sep 08 '20 at 09:17
  • i have tried to see the version as you mentioned.. but i got this error....'dotnet' is not recognized as an internal or external command,operable program or batch file. – goldenbutter Sep 08 '20 at 09:20
  • To configure servers you can use Powershell DSC to specify what should be installed on each one. Powershell itself will work to ensure all the requirements are met, by activating the relevant features. – Panagiotis Kanavos Sep 08 '20 at 09:22
  • `got this error.` because .NET Core isn't installed at all. What you ask is more an administration than a programming question - how automatically configure machines. Windows has a *lot* of technologies for this, starting from Group Policies in earlier versions, the ability to push configurations and even OS images to multiple machines, or using the same configuration on all machines in a business unit. To push configurations. Since 2012 one of the easiest ways is to use Powershell DSC – Panagiotis Kanavos Sep 08 '20 at 09:25
  • Check for example [Quickstart - Create a website with Desired State Configuration (DSC)](https://learn.microsoft.com/en-us/powershell/scripting/dsc/quickstarts/website-quickstart?view=powershell-7). You can apply this configuration to individual machines or create a group of machines and push the configuration to all of them – Panagiotis Kanavos Sep 08 '20 at 09:26
  • 1
    Does this help? https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed – lit Sep 08 '20 at 22:20
  • this actually helped me to understand if .NET framework is installed. thanks for this. But can you suggest me if this same with runtime and hosting bundle? If i was asked to check for those can i go with this same process? – goldenbutter Sep 09 '20 at 07:12

0 Answers0