Moesif.Middleware 1.1.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Moesif.Middleware --version 1.1.5
NuGet\Install-Package Moesif.Middleware -Version 1.1.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Moesif.Middleware" Version="1.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Moesif.Middleware --version 1.1.5
#r "nuget: Moesif.Middleware, 1.1.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Moesif.Middleware as a Cake Addin
#addin nuget:?package=Moesif.Middleware&version=1.1.5

// Install Moesif.Middleware as a Cake Tool
#tool nuget:?package=Moesif.Middleware&version=1.1.5

Moesif Middleware for DotNet

[![Built For][ico-built-for]][link-built-for] [![Latest Version][ico-version]][link-package] [![Software License][ico-license]][link-license] [![Source Code][ico-source]][link-source]

Middleware SDK that captures incoming or outgoing API calls from .NET apps and sends to Moesif API Analytics.

Source Code on GitHub

How to install

Install the Nuget Package:

Install-Package Moesif.Middleware

This SDK supports both .NET Core 2.0 or higher and .NET Framework 4.5 or higher. Jump to installation for your specific framework:

Net Core installation

In Startup.cs file in your project directory, please add app.UseMiddleware<MoesifMiddleware>(moesifOptions); to the pipeline.

To collect the most context, it is recommended to add the middleware after other middleware such as SessionMiddleware and AuthenticationMiddleware.

Add the middleware to your application:

using Moesif.Middleware;

public class Startup {

    // moesifOptions is an object of type Dictionary<string, object> which holds configuration options for your application.
    Dictionary<string, object> moesifOptions = new Dictionary<string, object>
    {
        {"ApplicationId", "Your Moesif Application Id"},
        {"LogBody", true},
        ...
        # For other options see below.
    };

    
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {

        app.UseMiddleware<MoesifMiddleware>(moesifOptions);
        app.UseMvc();
    }
}

Your Moesif Application Id can be found in the Moesif Portal. After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.

You can always find your Moesif Application Id at any time by logging into the Moesif Portal, click on the top-right menu, and then clicking Installation.

.NET Core example

Checkout the examples using .NET Core 2.0 and .NET Core 3.0

NET Framework installation

In Startup.cs file in your project directory, please add app.Use<MoesifMiddleware>(moesifOptions); to the pipeline.

To collect the most context, it is recommended to add the middleware after other middleware such as SessionMiddleware and AuthenticationMiddleware.

Add the middleware to your application:

using Moesif.Middleware;

public class Startup {
    
    // moesifOptions is an object of type Dictionary<string, object> which holds configuration options for your application.
    Dictionary<string, object> moesifOptions = new Dictionary<string, object>
    {
        {"ApplicationId", "Your Moesif Application Id"},
        {"LogBody", true},
        ...
        # For other options see below.
    };

    public void Configuration(IAppBuilder app)
    {
        app.Use<MoesifMiddleware>(moesifOptions);
    }
}

Your Moesif Application Id can be found in the Moesif Portal. After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.

You can always find your Moesif Application Id at any time by logging into the Moesif Portal, click on the top-right menu, and then clicking Installation.

Add OWIN dependencies

IIS integrated pipeline

If you're running your .NET app on IIS (or Visual Studio IIS Express) using integrated mode (most common), you will have to install the SystemWeb package if not done so already: Review OWIN Middleware in the IIS integrated pipeline for more info.

Install-Package Microsoft.Owin.Host.SystemWeb

Moesif does not support IIS running in Classic mode (Backwards compatibility for IIS 6.0). Unless your app predates IIS 6.0 and requires classic mode, you should switch to integrated mode.
{: .notice--primary}

Self-Host executable

While uncommon, if your application is a self-hosted executable that does not run on IIS, you may have to install the SelfHost package if not done so already:

For Web API applications:

Install-Package Microsoft.AspNet.WebApi.OwinSelfHost

For ASP.NET applications:

Install-Package Microsoft.Owin.SelfHost -Pre

.NET Framework Example

Checkout the Moesif .NET Framework Example using .NET Framework 4.6.1

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.3 1,286 11/8/2023
1.4.2 87 11/7/2023
1.4.1 96 11/3/2023
1.4.0 123 10/31/2023
1.3.25 3,376 8/8/2023
1.3.24 182 7/24/2023
1.3.23 158 6/13/2023
1.3.22 136 6/10/2023
1.3.21 162 6/10/2023
1.3.20 3,595 10/6/2022
1.3.19 381 10/5/2022
1.3.18 389 10/5/2022
1.3.17 453 9/13/2022
1.3.16 415 9/7/2022
1.3.15 422 9/1/2022
1.3.14 396 8/30/2022
1.3.13 2,822 4/15/2021
1.3.12 402 4/1/2021
1.3.11 380 3/26/2021
1.3.10 499 3/18/2021
1.3.8 443 3/12/2021
1.3.7 414 2/9/2021
1.3.5 408 2/4/2021
1.3.4 379 2/2/2021
1.3.3 391 1/15/2021
1.3.2 460 1/9/2021
1.3.1 590 6/15/2020
1.3.0 469 6/15/2020
1.2.1 461 6/11/2020
1.1.6 526 6/9/2020
1.1.5 462 6/8/2020
1.1.4 501 6/8/2020
1.1.3 634 1/7/2020
1.1.2 562 12/19/2019
1.1.1 562 12/14/2019
1.1.0 540 11/15/2019
1.0.3 560 10/22/2019
1.0.2 561 8/27/2019
1.0.1 671 8/23/2019
0.2.2 573 6/26/2019
0.2.1 584 6/18/2019
0.2.0 589 5/30/2019
0.1.7 579 3/23/2019
0.1.6 631 3/1/2019
0.1.5 607 2/25/2019
0.1.4 586 2/25/2019
0.1.3 645 2/11/2019
0.1.1 725 11/19/2018
0.1.0 758 11/17/2018