Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aspire does not launch #6114

Open
1 task done
tibold opened this issue Oct 4, 2024 · 10 comments
Open
1 task done

Aspire does not launch #6114

tibold opened this issue Oct 4, 2024 · 10 comments
Labels
area-acquisition untriaged New issue has not been triaged

Comments

@tibold
Copy link

tibold commented Oct 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Launching Aspire fails with an exception about not finding DCP.

Already tried reinstalling aspire workload in the Visual Studio Installer.

Expected Behavior

Aspire launches normally

Steps To Reproduce

No clue, the same project works on other machines.

Exceptions (if any)

info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.2.1+137e8dcae0a7b22c05f48c4e7a5d36fe3f00a8d7
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: D:\Work\Projects\Estaldo\brixter-hotfix\src\Launcher
fail: Aspire.Hosting.Dcp.the program finished with an error[0]
      {"ExitCode": 1, "error": "could not determine installed DCP extensions: CreateFile C:\\Users\\Tibold\\.dcp\\ext: The system cannot find the file specified."}

.NET Version info

.NET SDK:
 Version:           8.0.402
 Commit:            70aa751718
 Workload version:  8.0.400-manifests.d97747b4
 MSBuild version:   17.11.4+37eb419ad

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.402\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [aspire]
   Installation Source: SDK 8.0.400, VS 17.11.35312.102
   Manifest Version:    8.2.0/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.0\WorkloadManifest.json
   Install Type:        FileBased

 [wasm-tools]
   Installation Source: SDK 8.0.400, VS 17.12.35323.107, VS 17.11.35312.102
   Manifest Version:    8.0.8/8.0.100
   Manifest Path:       c:\program files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.8\WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      9.0.0-rc.1.24431.7
  Architecture: x64
  Commit:       static

.NET SDKs installed:
  6.0.321 [C:\Program Files\dotnet\sdk]
  6.0.425 [C:\Program Files\dotnet\sdk]
  8.0.400 [C:\Program Files\dotnet\sdk]
  8.0.402 [C:\Program Files\dotnet\sdk]
  9.0.100-rc.1.24452.12 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0-rc.1.24452.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  arm64 [C:\Program Files\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  D:\Work\Projects\Estaldo\brixter-hotfix\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

global.json

{
  "sdk": {
    "allowPrerelease": false,
    "version": "8.0.400",
    "rollForward": "latestMinor"
  }
}
@davidfowl
Copy link
Member

cc @joperezr

@joperezr
Copy link
Member

joperezr commented Oct 4, 2024

Thanks for opening the issue @tibold. Looks like you are not on the latest version of Aspire yet, can you please try running dotnet workload config --update-mode workload-set and dotnet workload update to install 8.2.1 and see if that fixes your issue?

If that doesn't work, can you please provide a binlog of your build so we can investigate further?

To produce one, you can call dotnet build /t:rebuild YourAppHostProject.csproj /bl:msbuild.binlog

@joperezr joperezr added the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 4, 2024
@tibold
Copy link
Author

tibold commented Oct 5, 2024

I tried the workload update:

dotnet workload update

Updated advertising manifest microsoft.net.workloads.
Installing workload version 8.0.402.1.
Downloading microsoft.net.workloads.8.0.400.msi.x64 (8.402.1)
Installing microsoft.net.workloads.8.0.400.msi.x64 .... Done
Downloading microsoft.net.workload.emscripten.current.manifest-8.0.100.msi.x64 (8.0.8)
Downloading microsoft.net.workload.emscripten.net6.manifest-8.0.100.msi.x64 (8.0.8)
Downloading microsoft.net.workload.emscripten.net7.manifest-8.0.100.msi.x64 (8.0.8)
Downloading microsoft.net.workload.mono.toolchain.current.manifest-8.0.100.msi.x64 (8.0.8)
Downloading microsoft.net.workload.mono.toolchain.net6.manifest-8.0.100.msi.x64 (8.0.8)
Downloading microsoft.net.workload.mono.toolchain.net7.manifest-8.0.100.msi.x64 (8.0.8)
Workload installation failed. Rolling back installed packs...
Removing microsoft.net.sdk.aspire.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.mono.toolchain.net7.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.mono.toolchain.net6.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.mono.toolchain.current.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.tvos.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.maui.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.macos.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.maccatalyst.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.ios.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.sdk.android.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.emscripten.net7.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.emscripten.net6.manifest-8.0.100.msi.x64 .... Done
Removing microsoft.net.workload.emscripten.current.manifest-8.0.100.msi.x64 .... Done
Installation rollback failed: Workload manifest microsoft.net.sdk.aspire: 8.2.1/8.0.100 from workload version 8.0.402.1 was not installed. Running "dotnet workload repair" may resolve this.
Removing microsoft.net.workloads.8.0.400.msi.x64 .... Done
Workload update failed: Workload manifest microsoft.net.sdk.aspire: 8.2.1/8.0.100 from workload version 8.0.402.1 was not installed. Running "dotnet workload repair" may resolve this.

Then I ran:

dotnet workload repair

Repairing workload installation for workloads: aspire wasm-tools
Repairing Aspire.Hosting.Sdk.Msi.x64 ............ Done
Repairing Aspire.ProjectTemplates.Msi.x64 .... Done
Repairing Microsoft.NET.Runtime.WebAssembly.Sdk.Msi.x64 .... Failed
Workload repair failed: Failed to repair 39129fe046f1dbf9be30a08b93de6b29-x64.msi. Error: 0x0000064c, The installation source for this product is not available. Verify that the source exists and that you can access it.

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Oct 5, 2024
@tibold
Copy link
Author

tibold commented Oct 5, 2024

Hey @joperezr ,

I have created a new aspire project from the Visual Studio 17.11.4 template to get a clean environment to test on.
Here is the output:

PS D:\Work\temp\aspire\AspireApp1\AspireApp1.AppHost> dotnet build /t:rebuild  /bl:msbuild.binlog
  Determining projects to restore...
  Restored D:\Work\temp\aspire\AspireApp1\AspireApp1.ServiceDefaults\AspireApp1.ServiceDefaults.csproj (in 177 ms).
  Restored D:\Work\temp\aspire\AspireApp1\AspireApp1.AppHost\AspireApp1.AppHost.csproj (in 176 ms).
  Restored D:\Work\temp\aspire\AspireApp1\AspireApp1.Web\AspireApp1.Web.csproj (in 177 ms).
  Restored D:\Work\temp\aspire\AspireApp1\AspireApp1.ApiService\AspireApp1.ApiService.csproj (in 177 ms).
  AspireApp1.ServiceDefaults -> D:\Work\temp\aspire\AspireApp1\AspireApp1.ServiceDefaults\bin\Debug\net8.0\AspireApp1.ServiceDefaults.dll
  AspireApp1.ApiService -> D:\Work\temp\aspire\AspireApp1\AspireApp1.ApiService\bin\Debug\net8.0\AspireApp1.ApiService.dll
  AspireApp1.Web -> D:\Work\temp\aspire\AspireApp1\AspireApp1.Web\bin\Debug\net8.0\AspireApp1.Web.dll
  AspireApp1.AppHost -> D:\Work\temp\aspire\AspireApp1\AspireApp1.AppHost\bin\Debug\net8.0\AspireApp1.AppHost.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.04
PS D:\Work\temp\aspire\AspireApp1\AspireApp1.AppHost> dotnet run
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.2.0+75fdcff28495bdd643f6323133a7d411df71ab70
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: D:\Work\temp\aspire\AspireApp1\AspireApp1.AppHost
fail: Aspire.Hosting.Dcp.the program finished with an error[0]
      {"ExitCode": 1, "error": "could not determine installed DCP extensions: CreateFile C:\\Users\\Tibold\\.dcp\\ext: The system cannot find the file specified."}
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      System.OperationCanceledException: The operation was canceled.

msbuild.zip

@tibold
Copy link
Author

tibold commented Oct 5, 2024

Did some digging. 😇 The binlog did indeed help. Didn't think to look at it before, although the structured log viewer is one of my pinned tools. 🙈

The culprit seems to be the generated assembly attribtues.
The code is looking for the following:

internal class ConfigureDefaultDcpOptions(
    DistributedApplicationOptions appOptions,
    IConfiguration configuration) : IConfigureOptions<DcpOptions>
{
    private const string DcpCliPathMetadataKey = "DcpCliPath";
    private const string DcpExtensionsPathMetadataKey = "DcpExtensionsPath";
    private const string DcpBinPathMetadataKey = "DcpBinPath";
    private const string DashboardPathMetadataKey = "aspiredashboardpath";

However, the SDK target on my machine is doing something different:

  <Target Name="SetOrchestrationDiscoveryAttributes" BeforeTargets="GetAssemblyAttributes" Condition=" '$(DcpDir)' != '' ">
    <PropertyGroup>
      <DcpDir>$([MSBuild]::EnsureTrailingSlash('$(DcpDir)'))</DcpDir>
      <DcpExtensionsDir Condition=" '$(DcpExtensionsDir)' == '' ">$([MSBuild]::NormalizePath($(DcpDir), 'ext'))</DcpExtensionsDir>
      <DcpExtensionsDir>$([MSBuild]::EnsureTrailingSlash('$(DcpExtensionsDir)'))</DcpExtensionsDir>
      <DcpBinDir Condition=" '$(DcpBinDir)' == '' ">$([MSBuild]::NormalizePath($(DcpExtensionsDir), 'bin'))</DcpBinDir>
      <DcpBinDir>$([MSBuild]::EnsureTrailingSlash('$(DcpBinDir)'))</DcpBinDir>
      <DcpCliPath Condition=" '$(DcpCliPath)'  == '' ">$([MSBuild]::NormalizePath($(DcpDir), 'dcp'))</DcpCliPath>
      <DcpCliPath Condition=" '$(OS)' == 'Windows_NT' and !$(DcpCliPath.EndsWith('.exe')) ">$(DcpCliPath).exe</DcpCliPath>
    </PropertyGroup>

    <ItemGroup>
      <AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
        <_Parameter1>dcpclipath</_Parameter1>
        <_Parameter2>$(DcpCliPath)</_Parameter2>
      </AssemblyAttribute>
      <AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
        <_Parameter1>dcpextensionpaths</_Parameter1>
        <_Parameter2>$(DcpExtensionsDir)</_Parameter2>
      </AssemblyAttribute>
      <AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
        <_Parameter1>dcpbinpath</_Parameter1>
        <_Parameter2>$(DcpBinDir)</_Parameter2>
      </AssemblyAttribute>
      <AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
        <_Parameter1>apphostprojectpath</_Parameter1>
        <_Parameter2>$(MSBuildProjectDirectory)</_Parameter2>
      </AssemblyAttribute>
    </ItemGroup>
  </Target>

Notice the "DcpExtensionsPath" vs dcpextensionpaths.

The following target in the apphost csproj makes my project boot:

	<Target Name="FixAspire" DependsOnTargets="SetOrchestrationDiscoveryAttributes" BeforeTargets="GetAssemblyAttributes">
		<ItemGroup>
			<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
				<_Parameter1>DcpExtensionsPath</_Parameter1>
				<_Parameter2>$(DcpExtensionsDir)</_Parameter2>
			</AssemblyAttribute>
		</ItemGroup>
	</Target>

What I don't quite understand yet, is how another machine boots Aspire.

@joperezr joperezr added the untriaged New issue has not been triaged label Oct 15, 2024
@davidfowl davidfowl removed the bug label Oct 16, 2024
@Broderick890
Copy link

same issue,how to fix it ?

@Broderick890
Copy link

info: Aspire.Hosting.DistributedApplication[0]
Aspire version: 9.0.0+01ed51919f8df692ececce51048a140615dc759d
info: Aspire.Hosting.DistributedApplication[0]
Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
Application host directory is: G:\Source\Test\AspireApp1\AspireApp1.AppHost
fail: Aspire.Hosting.Dcp.the program finished with an error[0]
{"ExitCode": 1, "error": "could not determine installed DCP extensions: CreateFile C:\Users\Administrator\.dcp\ext: The system cannot find the file specified."}

@gmatv
Copy link

gmatv commented Dec 12, 2024

In my case, the issue was with the symbolic link. I had created a link for the folder C:\Users[username].nuget to another drive due to a lack of space. After removing the link, it started to work.

@Broderick890
Copy link

Broderick890 commented Dec 12, 2024

In my case, the issue was with the symbolic link. I had created a link for the folder C:\Users[username].nuget to another drive due to a lack of space. After removing the link, it started to work.

wow, amazing! I had created a link for the nuget package folder. It works when i remove the link and change the package folder to other drive ! Thank you!

@almostchristian
Copy link

I have this issue as well. Initially, I set my NUGET_PACKAGES environment variable to a symlink path pointing to a Dev Drive. I changed the path to point to the dev drive directly and now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-acquisition untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

6 participants