How can I use IMessageSession in WebAPI controller .Net 4.8 (NServiceBus 7.x)

Is there an example available for NServiceBus 7.x and .Net Framework 4.8 WebAPI?
I have to use this combi to send a new message in one or more ApiControllers. All examples I can find are for .Net Core and not for .Net 4.8. How can I access MessageSession in the controller method in .Net 4.8?

Hey @jmateman,

We removed all the samples that targeted non-netcore web applications, but I was able to find some stuff by spelunking in the history of the repo. It’s not rendered like the docs site but you can still access the samples in the subdirectories. The variants for NServiceBus 7 will be in folders named Core_7.

Hi David,

Thank you for your response, I will take a look!

I find it very strange that you removed all non-netcore samples as the latest version of your product still supports it.
.NET 4.8 is still used in a lot of businesses and that will remain a fact for quite a couple of years. Microsoft supports it as long it is installed on a supported Windows version.
You are now hindering potential customers who are stuck with .NET Framework for whatever reason trying to innovate by introducing your product in them.

We did not remove all non-netcore samples, only the ASP.​NET ones, which represents only a small handful of samples. Most of our samples are multi-targeted (currently) to net7.0, net6.0, and net48. Our docs site engine splits these into separate single-framework downloadable zip files.

And really, they weren’t really “removed” either, but transitioned/rewritten to ASP.​NET Core when the demand for that rose.

One big complication is that ASP.​NET projects cannot use SDK-style .csproj files, which means they cannot be built with dotnet build, which complicates the entire toolchain.