Blazored/Localisation

[Question] blazor 3.2 preview 1

ofrades opened this issue · 6 comments

In this line: host.InitializeBlazoredLocalization();
I am getting this error:

'WebAssemblyHost' does not contain a definition for 'InitializeBlazoredLocalization' and no accessible extension method 'InitializeBlazoredLocalization' accepting a first argument of type 'WebAssemblyHost' could be found (are you missing a using directive or an assembly reference?)

I am using your settings but I have this error. Do you have any idea why?

I am also getting GET http://localhost:64590/_content/Blazored.Localisation/blazored-localisation.js 404 (Not Found)

The first error you're getting looks like a missing using statement. Are you sure everything is referenced correctly?

The second error is similar in that you would get this is there was error referencing the NuGet package.

As you're seeing both of these I would try removing the package and doing a clean of your solution - perhaps even delete your bin and obj folders. Once you've done that reinstall the package and try another built. It could be an odd caching issue, it's happened before.

The first error is the main problem. I have using Blazored.Localisation; on top; I have builder.Services.AddBlazoredLocalisation();and no error; but with host.InitializeBlazoredLocalization(); he complains: 'WebAssemblyHost' does not contain a definition for 'InitializeBlazoredLocalization' and no accessible extension method 'InitializeBlazoredLocalization' accepting a first argument of type 'WebAssemblyHost' could be found (are you missing a using directive or an assembly reference?)

I have deleted obj and bin folders, installed the package again, but with same results.

are you on visual studio 16.5.0 Preview 2.0 and are your packages updated to v3.2.0-preview1.2073.1 and is Blazored.Localisation updated to version 2.0?
Also, may I see your Main method in Program.cs? (just to see how you prepare and build the host)

Thanks mattgenious. I was using 1.1.1 and updating to 2.0.0 solved the issue. I am using vscode-insiders and to install NuGet packages I am using NuGet Gallery extension. The problem was that this extension was giving me wrongly the version 1.1.1 as the latest.