dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 168 forks source link

Running a project for Mobile Blazor Bindings failed for Windows app #427

Closed Bronzato1 closed 2 years ago

Bronzato1 commented 2 years ago

I tried to follow the 'Get Started' for Creating an app with Experimental Mobile Blazor Bindings

https://docs.microsoft.com/fr-fr/mobile-blazor-bindings/walkthroughs/build-first-hybrid-app

So I create my project by running this command:

dotnet new blazorhybrid -o FirstBlazorHybridApp

I can open the solution in Visual Studio 2019 and compile without problems.

I can even run the project inside the Android simulator. In Solution Explorer, right-click on the Android project and select Set as StartUp Project.

a

Unfortunately running the project for a Windows app failed.

b

I have no idea what may be the problem.

Eilon commented 2 years ago

Hi @Bronzato1 , add this package reference to the MyProjectName.Windows.csproj project:

    <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.961.33" />

And the problem should go away. This will be fixed in the next update!

Bronzato1 commented 2 years ago

It works. Thanks!