Unhandled exception. System.AggregateException: One or more errors occurred. (Unsupported value type System.Boolean)
---> System.NotSupportedException: Unsupported value type System.Boolean
at Aspire.Hosting.Azure.AzureResourcePreparer.ProcessAzureReferences(HashSet`1 azureReferences, Object value) in /_/src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:line 463
at Aspire.Hosting.Azure.AzureResourcePreparer.GetAzureReferences(IResource resource, CancellationToken cancellationToken) in /_/src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:line 377
at Aspire.Hosting.Azure.AzureResourcePreparer.BuildRoleAssignmentAnnotations(DistributedApplicationModel appModel, List`1 azureResources, AzureProvisioningOptions options, CancellationToken cancellationToken) in
/_/src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:line 142
at Aspire.Hosting.Azure.AzureResourcePreparer.BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken) in /_/src/Aspire.Hosting.Azure/AzureResourcePreparer.cs:line 39
at Aspire.Hosting.DistributedApplication.ExecuteBeforeStartHooksAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 475
at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 425
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 456
at Program.<Main>$(String[] args) in D:\DotNetTest\aspirenew\aspirenew.AppHost\AppHost.cs:line 26
Is there an existing issue for this?
Describe the bug
A NotSupportedException is thrown when referencing Azure Storage resources in an Aspire distributed app scenario. The error indicates "Unsupported value type System.Boolean" from AzureResourcePreparer.
Expected Behavior
The application should run without throwing a NotSupportedException when referencing Azure Storage resources.
Steps To Reproduce
Use the following repro code:
Exceptions (if any)
.NET Version info
Anything else?
Please investigate why referencing Azure Storage in this scenario triggers an unsupported value type exception and how to resolve it.