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

Generation of Message Pack fails with .Net 7 #1718

Open
mohamed-magdy opened this issue Dec 15, 2023 · 3 comments
Open

Generation of Message Pack fails with .Net 7 #1718

mohamed-magdy opened this issue Dec 15, 2023 · 3 comments

Comments

@mohamed-magdy
Copy link

Bug description

when i try to generate the message pack file using the mpc it crashes and gives me the following error message "System.IndexOutOfRangeException: Index was outside the bounds of the array.
at MessagePackCompiler.CodeAnalysis.TypeCollector.GetObjectInfo(INamedTypeSymbol type) in D:\a\1\s\src\MessagePack.GeneratorCore\CodeAnalysis\TypeCollector.cs:line 586
at MessagePackCompiler.CodeAnalysis.TypeCollector.CollectObject(INamedTypeSymbol type) in D:\a\1\s\src\MessagePack.GeneratorCore\CodeAnalysis\TypeCollector.cs:line 580
at MessagePackCompiler.CodeAnalysis.TypeCollector.CollectCore(ITypeSymbol typeSymbol) in D:\a\1\s\src\MessagePack.GeneratorCore\CodeAnalysis\TypeCollector.cs:line 381
at MessagePackCompiler.CodeAnalysis.TypeCollector.Collect() in D:\a\1\s\src\MessagePack.GeneratorCore\CodeAnalysis\TypeCollector.cs:line 301
at MessagePackCompiler.CodeGenerator.GenerateFileAsync(Compilation compilation, String output, String resolverName, String namespace, Boolean useMapMode, String multipleIfDirectiveOutputSymbols, String[] externalIgnoreTypeNames) in D:\a\1\s\src\MessagePack.GeneratorCore\CodeGenerator.cs:line 64
at MessagePack.Generator.MessagepackCompiler.RunAsync(String input, String output, String conditionalSymbol, String resolverName, String namespace, Boolean useMapMode, String multipleIfDirectiveOutputSymbols, String[] externalIgnoreTypeNames) in D:\a\1\s\src\MessagePack.Generator\MessagepackCompiler.cs:line 65
at ConsoleAppFramework.ConsoleAppEngine.RunCore(ConsoleAppContext ctx, Type type, MethodInfo methodInfo, String[] args, Int32 argsOffset)".

Repro steps

Code to reproduce the behavior.

Expected behavior

A clear and concise description of what you expected to happen.

Actual behavior

What happened instead of what you expected.

  • Version used: 2.5.124
  • Runtime: .net 7.0

Additional context

Add any other context about the problem here.

@AArnott
Copy link
Collaborator

AArnott commented Dec 15, 2023

Can you try using the source generator in the 2.6 prerelease? (docs in the README of the dev branch)
mpc is deprecated.

@Sean4572435243
Copy link

Sean4572435243 commented Feb 2, 2024

I looked at the readme changes here but I don't have a clue how to proceed with 2.6.100 without using mpc..Not using mpc just results in the expected "ClassLibrary1.Class1 is not registered in resolver" error. What are the steps?

@AArnott
Copy link
Collaborator

AArnott commented Feb 5, 2024

Those readme changes are too recent, perhaps. And incomplete, since you're only looking at a single commit. The readme at the tip of the develop branch is newer than the last prerelease to nuget.org at this point, so it'll be misleading unless you're using the latest CI build of the library from the develop branch.

Here's a precise link to exactly the readme content that is appropriate for the 2.6.100 prerelease on nuget.org. Hopefully that'll work for you.

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

No branches or pull requests

3 participants