C
C#8mo ago
Tim

Which package for asp.net middleware

I want to write my own middleware for asp.net as a class library but I cannot access HttpContext, RequestDelegate or IApplicationBuilder. Which package do I have to add to use those classes and interfaces?
7 Replies
Marvin
Marvin8mo ago
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
You can add this to your project file
Tim
TimOP8mo ago
Although it is deprecated?
Angius
Angius8mo ago
Microsoft.AspNetCore.Mvc?
Marvin
Marvin8mo ago
dont confuse nuget packages reference with framwork references,
Tim
TimOP8mo ago
Ah, the framework reference uses the build in stuff of the Web sdk?
Marvin
Marvin8mo ago
as far as i know it will use the available version of the asp runtime that is available on your hosting machine
Tim
TimOP8mo ago
yeah thats what i meant it seems to work, thanks

Did you find this page helpful?