pulumi / pulumi-ai

222 stars 15 forks source link

Generated C# code is missing static `Main` method with `Deployment.Run<MyStack>` invocation. #71

Open ringods opened 5 months ago

ringods commented 5 months ago

What happened?

I ran pulumi new with an AI prompt. When Pulumi triggers dotnet build to install the dependencies, I get this error:

Installing dependencies...

MSBuild version 17.5.1+f6fdcf537 for .NET
  Determining projects to restore...
  Restored /Users/ringods/Projects/pulumi-customers/refresh-jobschedule/refresh-jobschedule.csproj (in 1.87 sec).
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/Users/ringods/Projects/pulumi-customers/refresh-jobschedule/refresh-jobschedule.csproj]

Build FAILED.

CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/Users/ringods/Projects/pulumi-customers/refresh-jobschedule/refresh-jobschedule.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.63
error: installing dependencies failed; rerun manually to try again, then run `pulumi up` to perform an initial deployment: `dotnet build` failed to install dependencies: exit status 1

Example

AI prompt link taken from the generated Pulumi.yaml file:

pulumi:template: https://www.pulumi.com/ai/api/project/69059204-d5fb-41c7-ac09-8d19e7abbb50.zip

Output of pulumi about

CLI
Version 3.104.1 Go Version go1.21.6 Go Compiler gc

Host
OS darwin Version 14.2.1 Arch arm64

dotnet dependencies couldn't be fetched since the project doesn't build.

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).