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