Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error since adding MatBlazor: The types BlazorWebAssemblyHost and IWebAssemblyHostBuilder exist in two assemblies #30

Closed
BenjaminCharlton opened this issue Mar 12, 2019 · 13 comments

Comments

@BenjaminCharlton
Copy link

Hello MatBlazor developers!

Blazor and MatBlazor are both great ideas. I'm experimenting with them at the moment in a Blazor
app using v 0.9.0 Preview 3 of Blazor.

Since I installed the MatBlazor library (latest stable v 0.4.5 from Nuget) it has introduced a compilation error into my project. The error is below:

Error CS0433 The type 'IWebAssemblyHostBuilder' exists in both 'Microsoft.AspNetCore.Blazor.Browser, Version=0.7.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' and 'Microsoft.AspNetCore.Blazor, Version=0.9.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' BlazorClient C:\Users\USER\BlazorClient\Program.cs 12

And here is line 12-16 of Program.cs (which I have not changed - it's just from the template)

        public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args)
        {
            return BlazorWebAssemblyHost.CreateDefaultBuilder()
                .UseBlazorStartup<Startup>();
        }

Fully qualifying the names of these two classes (IWebAssemblyHostBuilder and BlazorWebAssemblyHost) did not help. I guess because they're exactly the same classes in the same namespaces but have moved from one DLL to another.

Can anybody assist with this error please?

Many thanks in advance!

Benjamin

@enginexon
Copy link
Collaborator

As I know MatBlazor was not updated to latest version of Blazor 0.9.
I guess @SamProf will update it soon.

@BenjaminCharlton
Copy link
Author

I hope so! It would be great to be able to use it again!

@SamProf
Copy link
Owner

SamProf commented Mar 13, 2019

I hope so! It would be great to be able to use it again!

I think will fix this today or tomorrow.

@SamProf
Copy link
Owner

SamProf commented Mar 14, 2019

Hello!

Now, on nuget available new version of MatBlazor 0.5
https://www.nuget.org/packages/MatBlazor/0.5.0

Work is not completed, some components still not works, but in general you can try to use MatBlazor with new Blazor 0.9.
Tomorrow I will try to fix all components.

Also in nearest feature I will improve and add new components.

@BenjaminCharlton
Copy link
Author

Thank you for your efforts on this and thank you for notifying us of your progress here, @SamProf!

@SamProf
Copy link
Owner

SamProf commented Mar 23, 2019

Now, I have made my upgraded release MatBlazor 0.6. (Upgraded to Blazor 0.9) and fix some problems.
I have started to test with Razor Components Application.

So, now MatBlazor works with client side Blazor 0.9.

I found that Razor Component Application not loaded empbedded resource content from my library - so, I need few days to fix this.
Also I have started new sprint to develop more components and imprrove existsing.
Thank you.

@BenjaminCharlton
Copy link
Author

Great news! Thanks for your efforts and keeping us updated.

@SamProf
Copy link
Owner

SamProf commented Mar 24, 2019

Hey!

I introduce v 0.6.1 with supporting Razor Components.
At the beginning of the your application, usually in MainLayout.cshtml please add MatBlazorInstall component
Thank you.

@SamProf SamProf closed this as completed Mar 28, 2019
@tedekeroth
Copy link

@SamProf Thanks for MatBlazor =) However, the error described above still exists:

The type 'IWebAssemblyHostBuilder' exists in both 'Microsoft.AspNetCore.Blazor.Browser, Version=0.5.1.0, Culture=neutral, PublicKeyToken=null' and 'Microsoft.AspNetCore.Blazor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

This happened when I added the https://www.nuget.org/packages/Cloudcrate.AspNetCore.Blazor.Browser.Storage/ package.

What am I missing? =)

@SamProf
Copy link
Owner

SamProf commented May 28, 2019

It's not because MatBlazor. You use old version of Cloudcrate.AspNetCore.Blazor.Browser.Storage

Latest is https://www.nuget.org/packages/Cloudcrate.AspNetCore.Blazor.Browser.Storage/3.0.0-preview5-19227-02

Conflict of versions of Blazor.

@tedekeroth
Copy link

Oh, I was using NuGet, and NuGet suggested 0.51 as the "latest stable", like this the attached picture. There isnt much I can do (I think) in the NuGet manager, I can only choose from the list, and 0.5.1 is the latest?
Image 006

@SamProf
Copy link
Owner

SamProf commented May 28, 2019

you should include prereleases
image

@tedekeroth
Copy link

Aha, thanks a lot for the info, got it and it works =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants