-
Notifications
You must be signed in to change notification settings - Fork 227
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
dotnet optimize fails because of private JsonReaderWriters #2972
Comments
@roji got the same problem compiling my own project, says "Cannot access private class If you need reproduction, you can try: [PrimaryKey(nameof(WalletType), nameof(AssetType), nameof(RecordedAt))]
[Table]
public sealed class AssetEntry {
[Column]
[Key]
public int AssetType { get; set; }
[Column]
[Key]
public DateTimeOffset RecordedAt { get; set; }
[Column]
[Key]
public int WalletType { get; set; }
} |
@JustArchi thanks for reporting, I'll take a look at this for 8.0.1. |
How can we workaround to resolve this issue while waiting for the next release? |
Getting a similar issue, but with NpgsqlJsonTimestampTzDateTimeReaderWriter, so it's probably all related?
Optimized code:
|
Everyone, I'm currently away and so unable to investigate this; I'm sure there's an actual issue here, but it'll take me a few days before I can investigate and fix it. You can probably expect a 8.0.1 to be released soon with the fix. |
@MinhMit my workaround is to change the generated files so they look like this:
which finally should return |
Thank you very much.You helped me solve this problem, I wouldn't have done it without you. |
Thank you so much. |
Hi, I upgraded my project to .NET 8.0
And when I run optimize dbcontext, I received error:
'NpgsqlTimestampTzTypeMapping.NpgsqlJsonTimestampTzDateTimeOffsetReaderWriter' is inaccessible due to its protection level
Please see attact image
The command is:
ef dbcontext optimize -o OptimizedModels -n ProjectName.Infrastructure.OptimizedModels -c PrimaryApplicationDbContext
What can I do to fix this issue? Any workaround for this?
The text was updated successfully, but these errors were encountered: