![]() |
VOOZH | about |
dotnet add package Raygun.Aspire.Hosting.Raygun --version 2.0.2
NuGet\Install-Package Raygun.Aspire.Hosting.Raygun -Version 2.0.2
<PackageReference Include="Raygun.Aspire.Hosting.Raygun" Version="2.0.2" />
<PackageVersion Include="Raygun.Aspire.Hosting.Raygun" Version="2.0.2" />Directory.Packages.props
<PackageReference Include="Raygun.Aspire.Hosting.Raygun" />Project file
paket add Raygun.Aspire.Hosting.Raygun --version 2.0.2
#r "nuget: Raygun.Aspire.Hosting.Raygun, 2.0.2"
#:package Raygun.Aspire.Hosting.Raygun@2.0.2
#addin nuget:?package=Raygun.Aspire.Hosting.Raygun&version=2.0.2Install as a Cake Addin
#tool nuget:?package=Raygun.Aspire.Hosting.Raygun&version=2.0.2Install as a Cake Tool
A locally running Raygun Crash Reporting portal for your Aspire orchestrator.
Install the Raygun.Aspire.Hosting.Raygun NuGet package into your Aspire orchestration project (AppHost). Either use the NuGet package management GUI in the IDE you use, OR use the below dotnet command.
dotnet add package Raygun.Aspire.Hosting.Raygun
In Program.cs of the AppHost project, call AddRaygun on the builder (after the builder is initialized and before it is used to build and run).
// The distributed application builder is created here
builder.AddRaygun();
// The builder is used to build and run the app somewhere down here
The steps so far will cause a Raygun resource to be listed in the orchestration app. Clicking on the URL of that resource will open a local Raygun portal in a new tab where you'll later be able to view crash reports captured in your local development environment. Find out everything you need to know about using this local Raygun portal in the documentation here.
In each of the projects in your Aspire app where you'll be capturing exceptions from, install the Raygun4Aspire NuGet package.
Then, in Program.cs, add a using Raygun4Aspire; statement, call AddRaygun on the WebApplicationBuilder followed by calling UseRaygun on the created application.
using Raygun4Aspire;
// The WebApplicationBuilder is created somewhere here
builder.AddRaygun();
// The builder is used to create the application a little later on
app.UseRaygun();
// Then at the end of the file, the app is commanded to run
Those are the minimal steps to get Raygun4Aspire capturing unhandled exceptions that occur during web requests in your local development environment. See the Raygun4Aspire documentation to log exceptions from try/catch blocks and other features.
In production appsettings files of each of your .NET projects, add the below RaygunSettings section. Substitute in your application API key that Raygun provides when you create a new Application in Raygun.
"RaygunSettings": {
"ApiKey": "YOUR_APP_API_KEY"
}
Get AI suggestions to resolve exceptions from a locally running LLM!
Install the Raygun.Aspire.Hosting.Ollama NuGet package into the Aspire orchestration project (AppHost). Either use the NuGet package management GUI in the IDE you use, OR the below dotnet command.
dotnet add package Raygun.Aspire.Hosting.Ollama
In Program.cs of the AppHost project, right above where you added the builder.AddRaygun(); line in Step 2 of the standard installation, you'll need to add the following line to add the Ollama container.
var ollama = builder.AddOllama();
Finally, you will need to modify the builder.AddRaygun(); line to add a reference to Ollama. 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
Now, when you view an exception that's been captured in the locally running Raygun portal, click the "AI Error Respolution" button in the top right corner to get AI suggestions on what to do about it. The first time you use this feature, the LLM will need to be downloaded. Keep the Aspire orchestration app open until this has completed. AI responses are not stored, and so they restart everytime you drill in to view an exception and click the button. Find out more details about how to use this feature here.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.