LsMsgPack.AspNet.Mvc
2026.10.28.2
See the version list below for details.
dotnet add package LsMsgPack.AspNet.Mvc --version 2026.10.28.2
NuGet\Install-Package LsMsgPack.AspNet.Mvc -Version 2026.10.28.2
<PackageReference Include="LsMsgPack.AspNet.Mvc" Version="2026.10.28.2" />
<PackageVersion Include="LsMsgPack.AspNet.Mvc" Version="2026.10.28.2" />
<PackageReference Include="LsMsgPack.AspNet.Mvc" />
paket add LsMsgPack.AspNet.Mvc --version 2026.10.28.2
#r "nuget: LsMsgPack.AspNet.Mvc, 2026.10.28.2"
#:package LsMsgPack.AspNet.Mvc@2026.10.28.2
#addin nuget:?package=LsMsgPack.AspNet.Mvc&version=2026.10.28.2
#tool nuget:?package=LsMsgPack.AspNet.Mvc&version=2026.10.28.2
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 LtMsgPack, 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: maps keyed by property names, readable by any MsgPack implementation. |
application/x-lsmsgpack |
The indexed schema with type ids: smaller, polymorphic, and with the schema sent only once per client. Use this between LsMsgPack / LtMsgPack endpoints. |
Usage
Register the model binder in Global.asax.cs:
using LsMsgPackMvc;
protected void Application_Start()
{
LsMsgPackMvc.LsMsgPackMvc.Register(); // or Register(new LtMsgPackHttpOptions { ... })
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 LtMsgPackHttpOptions { 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
- Web formatters: settings per media type,
LsMsgPackResult, schema negotiation - Compatibility with other MsgPack libraries
- Security: request bodies from clients you don't trust
- Source and issues: github.com/mlsomers/LsMsgPack
| Product | Versions 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. |
-
.NETFramework 4.6.2
- LtMsgPack (>= 2026.10.28.2)
- Microsoft.AspNet.Mvc (>= 5.2.9)
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 | 17 | 11/23/2026 |
| 2026.11.21.1 | 53 | 11/21/2026 |
| 2026.11.20.1 | 99 | 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 | 101 | 11/9/2026 |
| 2026.11.9.1 | 85 | 11/9/2026 |
| 2026.11.8.1 | 87 | 11/7/2026 |
| 2026.11.6.1 | 96 | 11/6/2026 |
| 2026.11.3.1 | 99 | 11/3/2026 |
| 2026.10.29.1 | 103 | 10/29/2026 |
| 2026.10.28.2 | 105 | 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 |