C
C#3y 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
Thinker3y 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
khamasOP3y ago
I tried to reference it but the type did not exist
JakenVeina
JakenVeina3y ago
out of curiosity, why do you need to reference WebApplication just to make some middleware?
khamas
khamasOP3y ago
I actually need to reference the builder, mb
JakenVeina
JakenVeina3y ago
isn't that an interface? IWebApplicationBuilder which exists in a separate Abstractions package?
khamas
khamasOP3y ago
yeah will check am on break rn
Accord
Accord3y 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.

Did you find this page helpful?