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 »

Thứ Tư, 25 tháng 12, 2024

Github workflow: How to checkout the same branch on a workflow that run after another workflow complete

 I have 2 github workflows: CreateRelease and Test. The Test workflow will run after CreateRelease workflow completed. How to make sure that the Test workflow will checkout the same branch with CreateRelease workflow?

Use ${{ github.event.workflow_run.head_branch }} in checkout action in Test workflow.

Here's CreateRelease workflow:

name: CreateRelease

on:
  workflow_dispatch:

jobs:
  ManageVariables:
    environment: 'QA Automation'
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true

Here's Test workflow:

name: Test

on:
  workflow_run:
    workflows: ["CreateRelease"]
    types:
      - completed
  workflow_dispatch:

jobs:
  ManageVariables:
    environment: 'QA Automation'
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.workflow_run.head_branch }}
          lfs: true


Read More »

Thứ Hai, 16 tháng 9, 2024

Note before publish/run webgl unity on IIS server to make the game run

 Shoud go to your webgl site in IIS then add mime types:


For example, after you build webgl, you have some files in the build folder:



You should add: .data, .wasm... and .unityweb with type application/octet-stream



Read More »

Thứ Bảy, 20 tháng 7, 2024

How to keep motivation when doing anything

 Whenever you feel very strong motivation at first when doing something, but by the time, your motivation is gone away?

Don't worry! That's normal. Everyone got the same issue with you. Let have an example. If it's the first time you learn to play piano. You are total new without any knowledge. A few first lessons, you learn musical notes, you know buttons that are represented for each note. You feel excited since you discovered new things, and it's simple and easy for you. You are enthusiastic waiting to the next lesson. But by the time, more complex and difficult technic come to you. You struggle with them. It takes you more time. And you start feeling less motivation. And finally you quit, thinking that you don't have ability to play piano.

That's because you don't know practicing V session. (Mindset secrets for winning by Mark Minervini)



The V session start with a relatively easy task, moves on to difficult part, then end with another easy task for strong finish. This takes advantage of the serial-position effect, which is a person’s tendency to recall the first and last events more vividly than the ones in the middle.





Read More »

Thứ Bảy, 24 tháng 2, 2024

Little Fox - Journey to the west - The water cave

 The monkey leaps through the waterfall and lands on a cave. It's a large cave, filled with bamboos, trees, and beautiful flowers. A stream flows through the cave, and moss covers the walls. He sees a long table with cups, plates, and bowls. A fireplace sits against one wall, and many cozy beds are present.



Other monkeys stand outside, thinking the monkey is washed away by the waterfall. They moan. Suddenly, with a splash, the monkey jumps out of the waterfall, landing in front of the other monkeys. "I found a beautiful home for all of us. Come inside," he announces.

The monkeys jump inside the waterfall one by one. They are very surprised and feel very interested. They fight for beds and try to take things from each other.

The monkey looks at his friend and coughs. Every monkey stops what they are doing and looks at him. "I found the cave, and now I'm your king. Why aren't you bowing to me?" he demands.

All monkeys bow to the monkey and call him "The Monkey King." Then they live happily in the cave. One day, while they are having a feast, the monkey suddenly feels sad. A friend notices his sadness and comes to ask him the reason. "Why are you sad?" he asks.

"Our lives are perfect," the monkey says, "and I want to live forever, but one day I will die."

"Then you can find a sage to learn how to live forever," the friend suggests. "You have to travel through the sea, reach the land where people live, and they can tell you where a sage lives."

The monkey builds a raft and loads fruits and nuts on it. He pushes it down the stream and jumps on board. He waves to his friend and says, "After I learn how to live forever, I'll come back!" The raft floats away, and his journey begins.

Read More »

Thứ Sáu, 23 tháng 2, 2024

Little Fox - The Final Chapter: The Secret Garden - In the Garden

Mr. Craven had wandered through Europe, visiting many beautiful places, famous mountains, and Norwegian fjords. Yet, it couldn't make him better; the cloud still hung over him.


One day, while hiking in a forest, he decided to rest on a carpet of moss beside a stream. He didn't know how long he had sat there, but the sunlight washed over him. As he looked around, he saw flowers blooming, birds singing, and the stream playing its gentle rhythm. And suddenly, he felt a sense of peace he hadn't experienced in a long time.

That night, he slept soundly, free from nightmares for the first time in months.

One day, while seated on a balcony chair in a hotel room, the moonlight bathed him in its soft glow. He drifted off to sleep and dreamed of his wife, who softly called out, "Archie! In the garden."

The next morning, a servant brought him a letter from Mrs. Sowerby, urging him to return home.

Upon his arrival, he immediately summoned Mrs. Medlock, inquiring about Colin's condition. However, she seemed hesitant to respond. He said nervously, "I think he might be better or worse. No one knows if he eats much or not at all."

Mr. Craven felt an inexplicable pull towards the secret garden. He had buried the key ten years ago, but a powerful intuition told him something was there, and he had to see it. He walked past the old fountain, now surrounded by vibrant flowers. He stopped at the garden door, and as if by magic, it creaked open. A boy burst out, bumping into him. "Father, I'm Colin!"

Mr. Craven couldn't believe his eyes. His son was running on his own legs! Was it a miracle wrought by the garden? "Tell me everything about it," he said, his voice trembling with emotion.

Colin led him into the garden and shared his story. As they walked through the yard, all the servants stared in astonishment. There was no longer a sickly boy, but a healthy young man walking freely, just like any other boy. 

Read More »