SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 384 forks source link

services.AddMvc().AddNewtonsoftJson() failing after adding NuGet package #140

Open dmarciano opened 5 years ago

dmarciano commented 5 years ago

I've just started working with Blazor (client/server model) and my initial test site was working. However, after installing the NuGet package, I can't run my site to test/debug. Specifically, in the ConfigureServices method of the Startup class, an exception is being thrown on the line services.AddMvc().AddNewtonsoftJson(); The exception is:

System.MissingMethodException: 'Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.AuthorizationServiceCollectionExtensions.AddAuthorization(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.'

However, if I uninstall the NuGet package and try running the site again locally it works fine. As I said, I'm very new to Blazor so maybe I'm just missing something.

Chadley08 commented 5 years ago

I can reproduce this issue, my app works fine without the MatBlazor package installation. Once I install the MatBlazor package, I get the same error, but it occurs on the services.AddRazorPages(); call in Startup.cs

Christian-Oleson commented 3 years ago

@Chadley08 @dmarciano , Is this still an issue?