Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to Implement Controllers Inherited from ControllerBase in Library-Type Assemblies?

$
0
0

I'm working with C# ASP.NET Core 6 and facing a challenge in implementing controllers inherited from ControllerBase in assemblies of the "library" type. Previously, it was possible to load packages like Microsoft.AspNetCore.Mvc.Core version 2.2.5 or Microsoft.AspNetCore.App version 2.2.8. This automatically added a controller when adding a NuGet package containing it to an API. However, these packages are now considered obsolete. Additionally, the same NuGet package version 6.0.0 isn't available for download from NuGet because it's now included in the standard ASP.NET Core package. But this isn't suitable for my use case as I am working with a class library.

How can I make controllers, inherited from ControllerBase, work in a class library with ASP.NET Core 6, considering the unavailability and obsoleteness of the aforementioned packages? Any guidance or alternative approaches would be greatly appreciated.

Microsoft.AspNetCore.App version 2.2.8 is deprecated.Microsoft.AspNetCore.Mvc.Abstractions version 6.0.0 doesn't work.Microsoft.AspNetCore.Mvc.Core version 6.0.0 doesn't work.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>