Thứ Sáu, 17 tháng 1, 2025

Azure Aspire hosting failed to start error

 On a beautiful day, after install new .net sdk, you suddenly can not start Aspire. The error is:

Hosting failed to start

      System.IO.FileNotFoundException: The Aspire orchestration component is not installed at "C:\Program Files\dotnet\packs\Aspire.Hosting.Orchestration.win-x64\8.1.0\tools\dcp.exe". The application cannot be run without it.


Look into the folder "C:\Program Files\dotnet\packs", the "8.1.0" folder does not exist. Not sure if .net installing process is removed "8.1.0" package.

So we have to reinstall "8.1.0" package at this folder.

Step 1: open Cmd by adminstrator right

Step 2: Navigate to Aspire host project

Step 3: Run this command to install 8.1.0 package to the folder "C:\Program Files\dotnet\packs":

dotnet add package Aspire.Hosting.Orchestration.win-x64 -v 8.1.0 --package-directory "C:\Program Files\dotnet\packs"

Step 4: Close visual studio, close browser

Step 5: Open Visual Studio, and clean the solution

Step 6: Run the project and enjoy

Read More »

Thứ Hai, 13 tháng 1, 2025

How to setup certificate for localhost IIS Express

 Step 1: Clean up all localhost certificates

  • Open "Manage user certificates" in the windows search box.
  • Select all localhost certificates in the "Personal/Certificates" folder and delete them.User's image
  • Select all localhost certificates in the "Trusted Root Certification Authorities/Certificates" folder and delete them. User's image
  • Open "Manage computer certificates" in the windows search box and then do the same things.

Step 2: Using the command line to re-run the setup of the SSL certificate.

  • Run cmd as administrator. Navigate to the IIS Express installation directory, the default path is typically:
        cd "C:\Program Files (x86)\IIS Express"
  • Now execute the following command to re-run the setup for the SSL certificates. Make sure to update the port number to match yours
IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:44321/ -UseSelfSigned
  • You will see the following output: User's image

Step 3: Re-run your application using IIS Express.

  • Restart Visual Studio and open your application.
  • Select IIS Express in Debug/Run Configurations and start the application.
  • You will see a popup, please select "Yes" to trust the new self-signed SSL certificate you generated for the localhost app. User's image
  • Then a security warning of "Install Certificate" on the local computer will pop up, please select "Yes" to install the certificate. User's image
  • Copy localhost certificate from Personal to Trusted Root Certification Certificates
  • After installing the certificate, the application will start normally.
Note: After doing above steps, close the browser then reopen it.

Source: https://learn.microsoft.com/en-us/answers/questions/1330161/iis-express-ssl-certificate-bindings-are-empty

Read More »