LsMsgPack.AspNet.Mvc 2026.11.23.1

dotnet add package LsMsgPack.AspNet.Mvc --version 2026.11.23.1
                    
NuGet\Install-Package LsMsgPack.AspNet.Mvc -Version 2026.11.23.1
                    
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="LsMsgPack.AspNet.Mvc" Version="2026.11.23.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LsMsgPack.AspNet.Mvc" Version="2026.11.23.1" />
                    
Directory.Packages.props
<PackageReference Include="LsMsgPack.AspNet.Mvc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LsMsgPack.AspNet.Mvc --version 2026.11.23.1
                    
#r "nuget: LsMsgPack.AspNet.Mvc, 2026.11.23.1"
                    
#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.
#:package LsMsgPack.AspNet.Mvc@2026.11.23.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LsMsgPack.AspNet.Mvc&version=2026.11.23.1
                    
Install as a Cake Addin
#tool nuget:?package=LsMsgPack.AspNet.Mvc&version=2026.11.23.1
                    
Install as a Cake Tool

LsMsgPack.AspNet.Mvc

MsgPack model binding and action result for ASP.NET MVC 5 controllers on .NET Framework 4.6.2+. Serializing is done by LsMsgPack, which reads and writes several times faster than System.Text.Json.

It speaks the same formats as LsMsgPack.AspNetCore and LsMsgPack.AspNet.WebApi (also for HttpClient).

Media type Format
application/msgpack, application/x-msgpack Plain MsgPack, readable by any MsgPack implementation: maps keyed by property names, every value, Guid and decimal as text, dates as timestamps (a DateTimeOffset loses its offset).
application/x-lsmsgpack The indexed schema with type ids: smaller, polymorphic, and with the schema sent only once per client. Use this between endpoints that use LsMsgPack (or LsMsgPackDebug).

Usage

Register the model binder in Global.asax.cs:

using LsMsgPackMvc;

protected void Application_Start()
{
  LsMsgPackMvc.LsMsgPackMvc.Register(); // or Register(new LsMsgPackHttpOptions { ... })
  RouteConfig.RegisterRoutes(RouteTable.Routes);
}

Complex parameters are then read from MsgPack request bodies (based on the Content-Type), all other requests are bound as usual. Return MsgPack with this.MsgPack(...), which picks the media type from the Accept header:

using LsMsgPackMvc;

public class OrdersController : Controller
{
  [HttpPost]
  public ActionResult Save(int id, Order order) // id from the route or query string, order from the MsgPack body
  {
    if (!ModelState.IsValid)
      return new HttpStatusCodeResult(400);

    return this.MsgPack(order);
  }
}

With Register(new LsMsgPackHttpOptions { ReportDifferences = true }), HttpContext.GetReadDifferences() says what didn't match between the request body and your classes, for example properties of another version of the models.

Documentation

Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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
2026.11.23.1 0 11/23/2026
2026.11.21.1 48 11/21/2026
2026.11.20.1 98 11/20/2026
2026.11.18.1 54 11/18/2026
2026.11.16.1 91 11/16/2026
2026.11.14.1 102 11/14/2026
2026.11.12.1 95 11/12/2026
2026.11.9.2 100 11/9/2026
2026.11.9.1 85 11/9/2026
2026.11.8.1 86 11/7/2026
2026.11.6.1 95 11/6/2026
2026.11.3.1 99 11/3/2026
2026.10.29.1 103 10/29/2026
2026.10.28.2 104 10/28/2026
2026.10.28.1 107 10/28/2026
2026.10.27.1 100 10/27/2026
2026.10.26.1 93 10/26/2026
2026.10.24.1 102 10/23/2026
2026.10.22.1 97 10/21/2026
2026.10.11.1 108 10/10/2026
Loading failed