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

Make sure to pass enum type to EnumConverter #172

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Sep 24, 2024

Fixes dotnet/runtime#108160

These were passing the type of the type, IOW System.Type which resulted in some members of the TypeConverter returning bad results, and caused an exception on construction in .NET 9.0.

These were passing the type of the type, IOW System.Type which resulted
in some members of the TypeConverter returning bad results, and caused
an exception on construction in .NET 9.0.
@ericstj
Copy link
Member Author

ericstj commented Sep 24, 2024

Note, there are 2 other EnumConverters in this codebase that don't have this bug.

internal class LocalizedEnumConverter : EnumConverter
{
private const string srTypeFullName = "Microsoft.SqlServer.Management.SqlScriptPublish.SR";
public LocalizedEnumConverter(Type type)
: base(type)

public abstract class EnumToDisplayNameConverter : EnumConverter
{
Type type = null;
/// <summary>
/// </summary>
protected EnumToDisplayNameConverter(Type type)
:base(type)

Copy link
Collaborator

@shueybubbles shueybubbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for the PR!
I guess SSMS never exercised the broken code paths; this code is ancient.
At some point I need to fix the build validation here too.

@shueybubbles shueybubbles merged commit 2a818b9 into microsoft:main Sep 24, 2024
2 of 4 checks passed
@last-Programmer
Copy link

Thanks for the quick fix.
@shueybubbles Could you please let me know when this fix will be released to nuget.

@last-Programmer
Copy link

I tried building from the source and now it works ok in ios and android in release config without and issue. thanks for the quick fix. waiting for the nuget release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Works in debug and exception in release mode with Sql Server SMO in IOS & Android
3 participants