-
Notifications
You must be signed in to change notification settings - Fork 446
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
System.IO.InvalidDataException for .Net 6 - 6.0.413 #17325
Comments
FAKE uses a library to collect and read MSBuild Binary logs (https://www.nuget.org/packages/MSBuild.StructuredLogger), but the version of the library it required is now too old to parse the binlogs created by newer versions of MSBuild shipped with the .NET SDK. To fix this, either FAKE needs to update it's dependency version, or your build project can manually bump this version. This is what I've done with all of the FAKE-using tools and libraries that I maintain. |
@baronfel thanks for the response. For the time being, I have lowered by dependency versions for dotnet 6 and dotnet 7, and the builds seem to be working fine. Can you tell me exactly what you did to fix the issue? So, issue shouldn't occur for latest versions of dotnet6 and dotnet7 |
You can see, my F# build project is here -> https://github.com/ably/ably-dotnet/tree/main/build-script. As per logs, it import
before starting build |
Yep! Add https://www.nuget.org/packages/MSBuild.StructuredLogger to your paket.dependencies file (to make it as a top-level dependency) and then run 'paket update MSBuild.StructuredLogger' and you should be good to go. |
Wow, Actually I had a thought of doing this, but never tried it! ( Kept updating
If I try to update
|
@baronfel if would be great, if you can help with this one 👍 |
you're using the incorrect packages here - remove |
@baronfel with above changes, seems I am still getting the same error here : ( It's the same error
|
@baronfel any help related to this would be useful. Seems removing
Gives above error : ( |
Also, adding |
@baronfel did you get time to look into this? |
What is your TargetFramework? Can you try and target net7.0? |
@KirillOsenkov I have targets for both net6.0 and net7.0, and it fails for both : ( |
You can check failing CI here ably/ably-dotnet#1199. |
You do need the latest version of MSBuild.StructuredLogger NuGet package. You will then run into another problem, because if you're targeting net6.0, then Microsoft.Build.Framework.dll doesn't get copied to the output directory, and your code fails when it tries to load it. I think if you target net7.0 this should be fixed. But you need to double-check. I'd check whether Microsoft.Build.Framework.dll is present in the output directory, and if not, build with /bl and inspect the resulting msbuild.binlog as to why the Microsoft.Build.Framework.dll isn't getting copied. |
@KirillOsenkov you can clone the repo and try to reproduce issue on the CI if needed 👍 |
Which branch/commit should I try? where is the commit where you update the binlog to latest? |
I found this commit: ably/ably-dotnet@e6531a8 The problem is that I think net7.0 will succeed, but net6.0 will fail. |
I'm running the tests locally with All I'm seeing is an unrelated timezone failure: For this error:
You need to make sure Microsoft.Build.Framework.dll is in the same directory as MSBuild.StructuredLogger.dll In this commit: You should keep Just remove the versions or use 17.5.0 |
Old issue triage: baronfel says this is likely solved at this point because of better compat of binlogs. Closing. |
Unhandled exception. Fake.Core.BuildFailedException: Target 'NetStandard - Build' failed.
---> System.AggregateException: One or more errors occurred. (String record number 30030 is invalid: string index -8 is not within 8488.)
---> System.IO.InvalidDataException: String record number 30030 is invalid: string index -8 is not within 8488.
at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.GetStringFromRecord(Int32 index) in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 1228
at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadDeduplicatedString() in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 1203
at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadOptionalString() in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 1192
at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.ReadTargetSkippedEventArgs() in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 293
at Microsoft.Build.Logging.StructuredLogger.BuildEventArgsReader.Read() in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BuildEventArgsReader.cs:line 167
at Microsoft.Build.Logging.StructuredLogger.BinLogReader.ReadRecordsFromDecompressedStream(Stream decompressedStream)+MoveNext() in C:\MSBuildStructuredLog\src\StructuredLogger\BinaryLogger\BinLogReader.cs:line 275
This started happening recently with latest versions of .Net 6 and .Net 7. For old versions, build works just fine.
more information related to error log -> https://github.com/ably/ably-dotnet/actions/runs/6133243415/job/16644925573
The text was updated successfully, but these errors were encountered: