dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.66k stars 418 forks source link

[WebToolsE2E][Aspire] There is a yellow message display "Ignoring other projects present but not referenced by app host:xxx" when running `azd init` and initializing it in Aspire Starter App project #5278

Open Rita003 opened 1 month ago

Rita003 commented 1 month ago

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install SDK 8.0.303
  3. Install Aspire 8.1.0
  4. Install latest released azd v1.9.5
  5. Install git v2.46.0

REPRO STEPS

  1. Open CMD, run following command to create an Aspire Starter App project and go to the solution folder
    dotnet new aspire-starter -o AspireStarterApp
    cd AspireStarterApp
  2. Running azd init, then select 'Use code in the current directory'

Note:

  1. This issue doesn't repro if I go to AspireStarterApp.AppHost project and running azd init in CMD.

ACTUAL There is a yellow message display when running azd init and initialize it Screenshot 2024-08-13 142233

EXPECTED Running azd init and initialize it without any message Screenshot 2024-08-13 144933

Error Log Ignoring other projects present but not referenced by app host: AspireStarterApp.ApiService and AspireStarterApp.Web

adamint commented 1 month ago

@snehapar9

davidfowl commented 1 month ago

cc @vhvb1989 @ellismg

rajeshkamal5050 commented 5 days ago

I believe you have to cd into app host project and run azd init cc @weikanglim

https://learn.microsoft.com/en-us/dotnet/aspire/deployment/azure/aca-deployment-azd-in-depth?tabs=windows#initialize-the-template

weikanglim commented 4 days ago

The warning message: Ignoring other projects present but not referenced by app host: AspireStarterApp.ApiService and AspireStarterApp.Web

Means that:

@ellismg @vhvb1989 Need someone to take a quick look what changed here (is it just the starter being weird? or did something change in how the filtering logic works in azd?)

ellismg commented 4 days ago

@ellismg @vhvb1989 Need someone to take a quick look what changed here (is it just the starter being weird? or did something change in how the filtering logic works in azd?)

I'll take a look, I don't think that anything changed here recently, so this is sort of surprising.

vhvb1989 commented 4 days ago

did not repro on Linux. It might be related to https://github.com/Azure/azure-dev/pull/4263 @ellismg

ellismg commented 3 days ago

I was unable to get this to repo on Windows with Aspire 8.2.0 and azd 1.10.1

Rita003 commented 2 days ago

@rajeshkamal5050 @ellismg I verified that this issue still repro when running azd init and initializing it in Aspire Starter solution with Aspire 8.2.0 and azd 1.10.1, and it also repro on Aspire 9.0P4 and azd 1.10.1, I want to confirm whether we can run azd init and initialize it in Aspire Starter solution?

vhvb1989 commented 2 days ago

@Rita003 , would it be possible for you to create a video and upload?

Also, can you run azd init --debug and share the logs?

thank you

ellismg commented 2 days ago

@Rita003 - Can you give me more details on the machine type in question as well? I wasn't able to get this to reproduce on Windows (via DevBox) with the exact same versions you use so I'm sort of confused as to what might be going on. I'm also just running azd init over the output of dotnet new aspire-starter so I really don't understand what the difference between yours and mine is.

Rita003 commented 1 day ago

@Rita003 , would it be possible for you to create a video and upload?

Also, can you run azd init --debug and share the logs?

thank you

@vhvb1989 This is the video I recorded

AZD

Run azd init --debug and share the logs

2024/09/20 02:12:37 main.go:56: azd version: 1.10.1 (commit 31409a33266fb4a5fdbb644bc83988e725d6c7c9)
2024/09/20 02:12:37 main.go:214: using cached latest version: 1.10.1 (expires on: 2024-09-20T04:52:43Z)
2024/09/20 02:12:37 user_config_manager.go:39: creating empty config since 'C:\Users\v-ritagao\.azd\config.json' did not exist.
2024/09/20 02:12:37 middleware.go:108: running middleware 'debug'
2024/09/20 02:12:37 middleware.go:108: running middleware 'ux'
2024/09/20 02:12:37 middleware.go:108: running middleware 'experimentation'
2024/09/20 02:12:37 experimentation.go:42: assignment context: 9936g960:76971;
2024/09/20 02:12:37 middleware.go:108: running middleware 'telemetry'
2024/09/20 02:12:37 telemetry.go:43: TraceID: 0ba36a2c0953ae59ed93a35d0c1fb082
2024/09/20 02:12:37 user_config_manager.go:39: creating empty config since 'C:\Users\v-ritagao\.azd\config.json' did not exist.
2024/09/20 02:12:37 command_runner.go:307: Run exec: 'git --version' , exit code: 0
-------------------------------------stdout-------------------------------------------
git version 2.46.1.windows.1
2024/09/20 02:12:37 git.go:55: git version: git version 2.46.1.windows.1

Initializing an app to run on Azure (azd init)

? How do you want to initialize your app? Use code in the current directory

  |       | Scanning app code in current directory2024/09/20 02:12:40 appdetect.go:251: Detecting projects in directory: C:\Users\v-ritagao\aspire3
2024/09/20 02:12:40 appdetect.go:251: Detecting projects in directory: C:\Users\v-ritagao\aspire3\aspire3.ApiService
  |===    | Scanning app code in current directory2024/09/20 02:12:40 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.ApiService\aspire3.ApiService.csproj --getProperty:IsAspireHost' , exit code: 0
  |====== | Scanning app code in current directory2024/09/20 02:12:41 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.ApiService\aspire3.ApiService.csproj --getProperty:RuntimeIdentifier' , exit code: 0
2024/09/20 02:12:41 appdetect.go:259: Found project dotnet at C:\Users\v-ritagao\aspire3\aspire3.ApiService
2024/09/20 02:12:41 appdetect.go:251: Detecting projects in directory: C:\Users\v-ritagao\aspire3\aspire3.AppHost
  |  =====| Scanning app code in current directory2024/09/20 02:12:42 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.AppHost\aspire3.AppHost.csproj --getProperty:IsAspireHost' , exit code: 0
2024/09/20 02:12:42 appdetect.go:259: Found project dotnet-apphost at C:\Users\v-ritagao\aspire3\aspire3.AppHost
2024/09/20 02:12:42 appdetect.go:251: Detecting projects in directory: C:\Users\v-ritagao\aspire3\aspire3.ServiceDefaults
  |     ==| Scanning app code in current directory2024/09/20 02:12:42 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.ServiceDefaults\aspire3.ServiceDefaults.csproj --getProperty:IsAspireHost' , exit code: 0
2024/09/20 02:12:42 appdetect.go:251: Detecting projects in directory: C:\Users\v-ritagao\aspire3\aspire3.Web
  |==     | Scanning app code in current directory2024/09/20 02:12:43 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.Web\aspire3.Web.csproj --getProperty:IsAspireHost' , exit code: 0
  |=====  | Scanning app code in current directory2024/09/20 02:12:44 command_runner.go:307: Run exec: 'dotnet msbuild C:\Users\v-ritagao\aspire3\aspire3.Web\aspire3.Web.csproj --getProperty:RuntimeIdentifier' , exit code: 0
2024/09/20 02:12:44 appdetect.go:259: Found project dotnet at C:\Users\v-ritagao\aspire3\aspire3.Web
  |      =| Scanning app code in current directory2024/09/20 02:12:54 command_runner.go:307: Run exec: 'dotnet run --project aspire3.AppHost.csproj --publisher manifest --output-path C:\Users\V-RITA~1\AppData\Local\Temp\azd-provision3962911680\apphost-manifest.json' , exit code: 0
-------------------------------------stdout-------------------------------------------
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.2.0+75fdcff28495bdd643f6323133a7d411df71ab70
info: Aspire.Hosting.Publishing.ManifestPublisher[0]
      Published manifest to: C:\Users\v-ritagao\AppData\Local\Temp\azd-provision3962911680\apphost-manifest.json
  (✓) Done: Scanning app code in current directory

Ignoring other projects present but not referenced by app host: aspire3.ApiService and aspire3.Web

Detected services:

  .NET (Aspire)
  Detected in: C:\Users\v-ritagao\aspire3\aspire3.AppHost\aspire3.AppHost.csproj

azd will generate the files necessary to host your app on Azure using Azure Container Apps.

? Select an option Confirm and continue initializing my app
2024/09/20 02:12:57 user_config_manager.go:39: creating empty config since 'C:\Users\v-ritagao\.azd\config.json' did not exist.
2024/09/20 02:12:57 project.go:144: Reading project from file 'C:\Users\v-ritagao\aspire3\azure.yaml'
? Enter a new environment name: Rita92001

Generating files to run your app on Azure:

2024/09/20 02:13:06 initializer.go:164: template init, checking for duplicates. source: C:\Users\V-RITA~1\AppData\Local\Temp\azd-infra1294484606 target: C:\Users\v-ritagao\aspire3
  (✓) Done: Generating ./azure.yaml
  (✓) Done: Generating ./next-steps.md

SUCCESS: Your app is ready for the cloud!
You can provision and deploy your app to Azure by running the azd up command in this directory. For more information on configuring your app, see ./next-steps.md
Rita003 commented 1 day ago

@Rita003 - Can you give me more details on the machine type in question as well? I wasn't able to get this to reproduce on Windows (via DevBox) with the exact same versions you use so I'm sort of confused as to what might be going on. I'm also just running azd init over the output of dotnet new aspire-starter so I really don't understand what the difference between yours and mine is.

@ellismg My reproduce machine type is Windows-11-Enterprise-23H2. This issue only reproduce when running azd init in Aspire Starter solution instead of AppHost project, this issue will not be reproduced if you go to AppHost project to run azd init. For the detailed steps, please refer to the video above.