You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Microsoft.NET.Publish.Tests.PublishItemsOutputGroupOutputsTests.RunPublishItemsOutputGroupOutputsTest fails for single-file win-x86 publishing #49926
This test fails for the single-file, RID-specific publish because the single-file apphost is locked when we try to take a file read:
TestPublishItemsOutputGroupOutputs failed with 1 error(s) (4.2s) → TestPublishItemsOutputGroupOutputs/bin/Debug/net6.0/win-x86/TestPublishItemsOutputGroupOutputs.dll
/workspaces/sdk/artifacts/bin/redist/Debug/dotnet/sdk/10.0.100-dev/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(1132,5): error MSB4018:
The "GenerateBundle" task failed unexpectedly.
System.IO.IOException: The process cannot access the file '/workspaces/sdk/artifacts/tmp/Debug/testing/RunPublishIte---00D00966/TestPublishItemsOutputGroupOutputs/obj/Debug/net6.0/win-x86/singlefilehost.exe' because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.File.OpenRead(String path) at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs) at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore() in /workspaces/sdk/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs:line 81 at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /workspaces/sdk/src/Tasks/Common/TaskBase.cs:line 36 at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
The GenerateBundle task in question is calling into the runtime-provided APIs for making the single-file apphost for this project, and as part of that a File.OpenRead cannot be taken.
dotnet/runtime#116659 did change how we read the original singlefilehost executable and write out the bundle - cc @jtschuster in case you have seen something like it / have ideas. Only thing I could think is we might be hitting anti-virus software sadness again? If it is scanning the original source in the obj/ directory when we try to read it in?
Side note: do we still really need to test targeting win7?
This one isn't win7, but it is win-x86. How much do we care/support this target still?
Activity
baronfel commentedon Jul 24, 2025
From @elinor-fung in #49740 (comment) for a similar issue:
This one isn't win7, but it is win-x86. How much do we care/support this target still?
SimonZhao888 commentedon Aug 5, 2025
Close this issue as it has been reopened by #50031.
marcpopMSFT commentedon Sep 25, 2025
track with 50784 which uses the known issue infra.