Introducing Raygun AI Error Resolution for Aspire

| 3 min. (572 words)

Last month, we rolled out Raygun4Aspire, our Crash Reporting client for .NET Aspire applications. That release included a free, lightweight version of the full Raygun web app that runs locally. After the successful launch of our recent AI Error Resolution feature for Crash Reporting, we knew that we had to bring this feature into the Aspire local development experience.

Today, we’re thrilled to announce that AI Error Resolution for Raygun4Aspire is now available for all Aspire app developers! This feature uses a locally running Ollama container hosting a Llama3 model to analyze your exception reports.

To get started, make sure you’ve integrated Raygun4Aspire into your Aspire application by following the instructions here. If you’re already using Raygun4Aspire, note that to upgrade to version 2, you’ll need to uninstall the Raygun4Aspire NuGet package from just the Aspire Orchestration project (AppHost). Then, replace it with the Raygun.Aspire.Hosting.Raygun NuGet package.

Now, you can follow these steps to set up your own locally running AI assistant to help you resolve errors:

Install the Aspire Hosting Ollama NuGet package

You’ll need to add a NuGet package, like you did when installing Raygun4Aspire. This one is called Raygun.Aspire.Hosting.Ollama. You may either use the NuGet package management GUI in your IDE, or the below dotnet command.

dotnet add package Raygun.Aspire.Hosting.Ollama

Add Ollama to the orchestration builder

In Program.cs of the AppHost project, right above where you added the builder.AddRaygun(); line in the standard installation, you’ll need to add the following line to include Ollama.

var ollama = builder.AddOllama();

Reference Ollama in the Raygun component

Finally, you will need to modify the builder.AddRaygun(); line to add a reference to the Ollama component. Your final code should look like this.

// The distributed application builder is created here

var ollama = builder.AddOllama();
builder.AddRaygun().WithReference(ollama);

// The builder is used to build and run the app somewhere down here

Congratulations! You have successfully set up the Ollama container, enabling AI Error Resolution for Raygun4Aspire. You will now see the AI Error Resolution button in the top right corner of the page when viewing an error in the local Raygun app, as highlighted below.

AI Error Resolution button for Raygun4Aspire

Usage Guide

Click the AI Error Resolution button to open the AI panel. The first time you use this feature, it will download the LLM (Llama3) into the Ollama container. This might take a few minutes, and you’ll see a progress bar showing how much is done. This only happens once. Just make sure to keep the Aspire AppHost open until the download finishes to avoid cancelling it.

Setting up AI Error Resolution for Raygun4Aspire

After your local Ollama container is ready, a prompt containing your error data will be automatically sent. We will relay the response back to the AI panel in real time. A complete response will look something like this:

AI Error Resolution dialogue for Raygun4Aspire

Note that AI responses are not stored, except on the same error page during the same visit to that page. If you close the AI panel and reopen it, the response will remain the same. If it was incomplete, it will continue to be generated. However, if you leave that error page and come back, the response you receive will be different. Keep this in mind when leaving an error page.

You are now all set to use AI Error Resolution from your Raygun4Aspire application to accelerate fixing all those issues that crop up!

Not a Raygun customer yet? Try out the full Crash Reporting application free for 14 days! No credit card required.