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 CS0122: 'NotifyCollectionChangedAction' is inaccessible due to its protection level #1813

Closed
manodasanW opened this issue Oct 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@manodasanW
Copy link
Member

manodasanW commented Oct 9, 2024

Collection of built-in WinRT mapped enums don't have the right generic instantiations generated for them. NotifyCollectionChangedAction isn't marked blittable in our mapping when it probably should be.

@manodasanW manodasanW added the bug Something isn't working label Oct 9, 2024
@manodasanW manodasanW self-assigned this Oct 9, 2024
@U-C-S
Copy link

U-C-S commented Oct 9, 2024

CS0122	'ILauncherUIOptions' is inaccessible due to its protection level	
CS0122	'ILauncherOptions' is inaccessible due to its protection level	

I am having similar issue for the following

<PropertyGroup>
	<CsWinRTEmbedded>true</CsWinRTEmbedded>
	<CsWinRTWindowsMetadata>sdk</CsWinRTWindowsMetadata>
	<CsWinRTGenerateProjection>true</CsWinRTGenerateProjection>
</PropertyGroup>
<ItemGroup>
	<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.5" />
</ItemGroup>
<PropertyGroup>
	<CsWinRTIncludes>
		Windows.Foundation;
		Windows.System.LauncherOptions;
		Windows.System.Launcher;
	</CsWinRTIncludes>
	<CsWinRTExcludes>
		Windows.Foundation.PropertyType;
	</CsWinRTExcludes>
</PropertyGroup>

@manodasanW
Copy link
Member Author

manodasanW commented Oct 10, 2024

CS0122	'ILauncherUIOptions' is inaccessible due to its protection level	
CS0122	'ILauncherOptions' is inaccessible due to its protection level	

I am having similar issue for the following

true sdk true Windows.Foundation; Windows.System.LauncherOptions; Windows.System.Launcher; Windows.Foundation.PropertyType;

Can you confirm what target framework (TFM) you are targeting and what your scenario is? I feel like you are running into an unrelated issue. With embedded support, you use it typically to embed a projection within your own sources when you are unable to target the netx-windows10.0.xxxxx.0 TFM. In your case, based on the protection level error, I feel like you are indeed targeting that TFM. With embedded support today, typically you would need to list the exclusive interfaces too like Windows.System.ILaunchOptions on the CsWinRTIncludes. If you are not targeting the TFM I mentioned and you are still seeing the same issue, feel free to open another issue as I am probably going to close this one as part of the PR that got merged to fix that.

@manodasanW manodasanW added this to the Release 2.1.6 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants