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