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

fixing build error for PrintSystemPathResolver #10056

Closed
wants to merge 1 commit into from

Conversation

hiteshkrmsft
Copy link
Contributor

@hiteshkrmsft hiteshkrmsft commented Nov 12, 2024

Description

We recently encountered the following build error in WPF:

C:\Users\X\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\CPP\src\PrintSystemPathResolver.cpp(308,50): error C5307: 'int System::String::IndexOf(wchar_t,int)': argument (1) converted from 'char' to 'wchar_t'. Missing 'L' encoding-prefix for character literal? [C:\Users\ X\source\repos\wpf\src\Microsoft.DotNet.Wpf\src\System.Printing\System.Printing.vcxproj]

Cause
The error suggests that the IndexOf method expects a wchar_t type for the character literal, but a char is currently being passed. This is due to recent changes in the IndexOf method for System::String or updates in compiler behavior.

Fix
This PR addresses the issue by converting the character to a wide character using the L prefix, ensuring compatibility with the expected wchar_t type.

Testing

Built locally

Risk

Low, doesn't introduce any behavior change

Microsoft Reviewers: Open in CodeFlow

@hiteshkrmsft hiteshkrmsft requested review from a team as code owners November 12, 2024 04:47
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Nov 12, 2024
@pchaurasia14
Copy link
Member

Closed since the changes were already merged as part of #10023

@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants