Skip to content

MSB4018: System.IO.EndOfStreamException #28734

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

Open
deeprobin opened this issue Oct 22, 2022 · 6 comments
Open

MSB4018: System.IO.EndOfStreamException #28734

deeprobin opened this issue Oct 22, 2022 · 6 comments

Comments

@deeprobin
Copy link
Contributor

Issue Description

My build is failing with a weird error. I can't share a reproduction unfortunately as it is a larger project. Actually I'm trying to build a .NET runtime (dotnet/runtime) project - It seems, however, not to be due to the build infrastructure of the repository.

The error only occurs since I updated the SDK to the latest RC version.

Steps to Reproduce

  • Build any project with .NET 7.0.100-rc.2.22477.23

Expected Behavior

Passing build

Actual Behavior

binlog.zip

C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018: Unerwarteter Fehler bei der ResolvePackageAssets-Aufgabe.
[E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018: System.IO.EndOfStreamException: Unable to read beyond the
end of the stream. [E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at System.IO.BinaryReader.InternalRead(Int32 numBytes)
[E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at System.IO.BinaryReader.ReadInt32() [E:\external\dotn
et\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.Cache
Reader.ReadItemGroup() [E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadI
temGroups() [E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolvePackageAssets.Execu
teCore() [E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [E:\ext
ernal\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.
Build.BackEnd.ITaskExecutionHost.Execute() [E:\external\dotnet\runtime\src\libraries\System.Collections\ref\System.Collections.csproj]
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantia
tedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [E:\external\dotnet\runtime\src\libraries\System.
Collections\ref\System.Collections.csproj]

... (see binlog)

Analysis

I don't know if this or sdk is the right repo

Versions & Configurations

MSBuild version 17.4.0-preview-22470-08+6521b1591 for .NET
17.4.0.47008

SDK 7.0.100-rc.2.22477.23

@danmoseley
Copy link
Member

If you clean and then build does it still happen? Wonder whether the upgraded version can't read a file written by the previous version.

@deeprobin
Copy link
Contributor Author

@danmoseley Unfortunately, yes.

@rainersigwald
Copy link
Member

The task in question lives in dotnet/sdk so I'll move this.

@rainersigwald rainersigwald transferred this issue from dotnet/msbuild Oct 24, 2022
@ghost ghost added Area-NetSDK untriaged Request triage from a team member labels Oct 24, 2022
@rainersigwald
Copy link
Member

rainersigwald commented Oct 24, 2022

I believe, though, that this will be fixed (in 7.0.100 GA) by #28222.

@nagilson
Copy link
Member

nagilson commented Oct 25, 2022

@deeprobin May you please report back if this is fixed in GA once released?

For now, it would be great if we could supply a workaround. But there's no current release that contains this fix. @marcpopMSFT @baronfel Do we have some sort of standardized, temporary-workaround guidance for customers who could be fixed by updating their SDK to an unofficial release? Alternatively, they could probably apply the patch https://github.com/dotnet/sdk/pull/28222/files here onto their local copy of the SDK since it's quite simple.

@nagilson nagilson removed the untriaged Request triage from a team member label Oct 25, 2022
@marcpopMSFT
Copy link
Member

Assuming it flowed into 7.0.2xx, that's what I would recommend someone installing to get unblocked. I realized the installer table wasn't updated so doing that too: dotnet/installer#14831

@nagilson nagilson removed their assignment Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants