aspire: Aspire does not launch

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"
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 27 (14 by maintainers)

Most upvoted comments

FWIW, the issue was fixed (🤞), if all goes well, it’ll be available in the next release. (And if not, then in the one that follows).

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.

TBC I don’t believe this is a Dev Drive problem, but rather a problem when redirecting your nuget packages location to another location via a symlink. If you mount a Dev Drive as a directory on an existing volume, then you’ll end up with a symlink, but it’s not the Dev Drive that’s the issue.

I just ran into this problem. I have a Dev Drive (in a separate partition) mounted at C:\Code and NUGET_PACKAGES set to C:\Code\Cache\NuGet. Under this configuration, Aspire won’t start.

In Disk Management, I added the drive letter D: to the Dev Drive partition, then set NUGET_PACKAGES to D:\Cache\NuGet. (No part of this path is a symlink.) Aspire now loads.

(Not sure if this will work for those who have a Dev Drive in a VHD.)

I can confirm this is most likely a DCP issue and should be a pretty easy fix. We are using an API that is documented to not follow symbolic links (incl. junctions on Windows). We just probably to call another API to get to the target path before looking for extensions.

I feel as though this is a bug in dcp itself - i.e., it fails to resolve the symlink.

Like the others in this thread, I have redirected my global nuget cache to another drive.

https://github.com/dotnet/aspire/blob/89e329c95ebac571567a58f27bfeb462d8e6b35d/Directory.Build.props#L47 https://github.com/dotnet/aspire/blob/89e329c95ebac571567a58f27bfeb462d8e6b35d/src/Aspire.Hosting.AppHost/build/Aspire.Hosting.AppHost.targets#L195-L201 This resolves to: Image …and can be accessed in Explorer: Image

At runtime these get read seemingly correctly: Image Image Image

…then boom! Image