-
Notifications
You must be signed in to change notification settings - Fork 855
withReference doesn't work between addCSharpApp in polyglot #15121
Description
The following apphost doesn't work:
import { createBuilder } from './.modules/aspire.js';
const builder = await createBuilder();
var one = await builder.addCSharpApp("one", "one.cs");
await builder.addCSharpApp("two", "two.cs")
.withReference(one);
await builder.build().run();The error I get is:
❌ Uncaught Exception: Capability 'Aspire.Hosting/withReference' requires handle of type 'expected type', got 'Object of type 'Aspire.Hosting.DistributedApplicationResourceBuilder1[[ Aspire.Hosting.ApplicationModel.CSharpAppResource]]' cannot be converted to type 'Aspire.Hosting.ApplicationModel.IResourceBuilder1[[Aspire.Hosting.ApplicationModel.IResourceWithConnectionString]]'.'
CapabilityError: Capability 'Aspire.Hosting/withReference' requires handle of type 'expected type', got 'Object of type 'Aspire.Hosting.DistributedApplicationResourceBuilder1[[ Aspire.Hosting.ApplicationModel.CSharpAppResource]]' cannot be converted to type 'Aspire.Hosting.ApplicationModel.IResourceBuilder1[[Aspire.Hosting.ApplicationModel.IResourceWithConnectionString]]'.'
at AspireClient.invokeCapability (D:\DotNetTest\TSCheck.modules\transport.ts:553:23)
at async ProjectResource._withReferenceInternal (D:\DotNetTest\TSCheck.modules\aspire.ts:13553:24)
at async (D:\DotNetTest\TSCheck\apphost.ts:8:1)
❌ An unexpected error occurred: The TypeScript (Node.js) apphost failed.