After upgrading my .NetCore 2.2
application to Net Core 3.1
. I am now facing issue in the startup.cs
file related to a UseSpaStaticFiles()
method.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app
.UseCors("default")
.UseStaticFiles()
.UseSpaStaticFiles(); // this line is giving me error.
.....
}
The error says :
Error CS1061 'IApplicationBuilder' does not contain a definition for 'UseSpaStaticFiles' and no accessible extension method 'UseSpaStaticFiles' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)
To resolve the issue I have tried installing Microsoft.AspNetCore.SpaServices
package from Nuget and that also didn't help.
This method is contained in the
Microsoft.AspNetCore.SpaServices.Extensions
NuGet package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With