C
C#4mo 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
Marvin4mo ago
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
You can add this to your project file
Tim
TimOP4mo ago
Although it is deprecated?
Angius
Angius4mo ago
Microsoft.AspNetCore.Mvc?
Marvin
Marvin4mo ago
dont confuse nuget packages reference with framwork references,
Tim
TimOP4mo ago
Ah, the framework reference uses the build in stuff of the Web sdk?
Marvin
Marvin4mo ago
as far as i know it will use the available version of the asp runtime that is available on your hosting machine
Tim
TimOP4mo ago
yeah thats what i meant it seems to work, thanks
Want results from more Discord servers?
Add your server