Search code examples
c#.net-6.0visual-studio-2022maui-blazormulti-device-hybrid-apps

Visual Studio 22 getting crashed while publishing the MAUI Blazor Hybrid app


I'm using Visual Studio 2022 to create the MAUI Blazor Hybrid application, Visual Studio crashed (Automatically Closed) while publishing the MAUI Blazor Hybrid application to the Windows platform.

The below steps are followed to publish

  1. Changed the build platform to the Windows Changed to Windows platform
  2. Changed the build mode to the Release
  3. Right-click on the Startup project and select the Publish... option
  4. Visual Studio is Loading 5 to 10 sec then it's closed automatically

Why is Visual Studio 2022 closed while publishing the MAUI Blazor Hybrid application to Windows platform? Do I need to add any configuration to the project file with the respective Windows platform publishing?


Solution

  • I have created the empty MAUI Blazor Hybrid application and checked it. There I'm able to publish the application. So I compared the .csproj file of both projects. In my application, the <WindowsPackageType>None</WindowsPackageType> line is there, so I removed this line. Now I'm able to publish.