C
C#15mo ago
khamas

✅ referencing `WebApplication` from a class library

Hey so I'm trying to create a middleware library, but I can't install Microsoft.AspNetCore.App.Ref package as it is an internal library, how can I reference WebApplication?
7 Replies
Thinker
Thinker15mo ago
afaik you can include <FrameworkReference Include="Microsoft.AspNetCore.App" /> in your csproj to reference the ASP.NET core library without the library being a web app.
khamas
khamas15mo ago
I tried to reference it but the type did not exist
JakenVeina
JakenVeina15mo ago
out of curiosity, why do you need to reference WebApplication just to make some middleware?
khamas
khamas15mo ago
I actually need to reference the builder, mb
JakenVeina
JakenVeina15mo ago
isn't that an interface? IWebApplicationBuilder which exists in a separate Abstractions package?
khamas
khamas15mo ago
yeah will check am on break rn
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.