You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a WinUI 3 app has the CA1515: Consider making public types internal code rule enabled, the App class can not be made internal due to its partial class generated in XamlTypeInfo.g.cs is made public.
Steps to reproduce the bug
Create a blank WinUI 3 app with VisualStudio's WinUI 3 app template.
Go to App.xaml.cs, change the App class's access modifier from public to internal.
Build the project.
Build fails with the following error:
Error (active) CS0262 Partial declarations of 'App' have conflicting accessibility modifiers
Expected behavior
App should be able to successfully build when change App to internal.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
Windows version
Windows 11 (24H2): Build 26100
Additional context
Upon search there are 3 generated partial classes for App. While the following two do not have access modifier: partial class App : global::Microsoft.UI.Xaml.Application
the generated partial class in
.\obj\x64\Debug\net8.0-windows10.0.22621.0\win-x64\XamlTypeInfo.g.cs
has public partial class App : global::Microsoft.UI.Xaml.Markup.IXamlMetadataProvider.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a WinUI 3 app has the CA1515: Consider making public types internal code rule enabled, the
App
class can not be madeinternal
due to its partial class generated in XamlTypeInfo.g.cs is madepublic
.Steps to reproduce the bug
App
class's access modifier from public to internal.Expected behavior
App should be able to successfully build when change App to internal.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
Windows version
Windows 11 (24H2): Build 26100
Additional context
Upon search there are 3 generated partial classes for App. While the following two do not have access modifier:
partial class App : global::Microsoft.UI.Xaml.Application
.\obj\x64\Debug\net8.0-windows10.0.22621.0\win-x64\Views\App.g.cs
.\obj\x64\Debug\net8.0-windows10.0.22621.0\win-x64\Views\App.g.i.cs
the generated partial class in
.\obj\x64\Debug\net8.0-windows10.0.22621.0\win-x64\XamlTypeInfo.g.cs
has
public partial class App : global::Microsoft.UI.Xaml.Markup.IXamlMetadataProvider
.The text was updated successfully, but these errors were encountered: