Open adc-cjewett opened 1 week ago
ProcessResourceFiles seems to derive from MarshalByRefObject on .NET Framework:
The GenerateResource task doesn't seem to be doing anything about leases for cross-appdomain remoting. If the operation lasts longer than the timeouts configured in LifetimeServices, then perhaps .NET Framework disconnects the ProcessResourceFiles instance from remoting. This might be fixable by making ProcessResourceFiles override the MarshalByRefObject.InitializeLifetimeService method to return null. The caller will unload the whole AppDomain anyway, so the lease mechanism is not useful for ProcessResourceFiles.
We did turn on the /graph
option recently when running builds which improved our compilation performance significantly. Any chance that option has a direct impact on this?
We're assuming that the optimized resource usage as a result of /graph
being enabled is indirectly impacting it because the machine is being utilized more heavily as a result of optimized building, but figured I'd double check there is no direct tie.
dotnet msbuild
would not have this problem, because .NET Core does not support remoting and MSBuild does not attempt to use it there. It might be incompatible with your projects for other reasons, though.
Setting ResGenExecuteAsTool=true might work around the problem, by making the GenerateResource task run ResGen.exe as a child process instead of using cross-AppDomain remoting. It could be slower, though.
dotnet msbuild
would not have this problem, because .NET Core does not support remoting and MSBuild does not attempt to use it there. It might be incompatible with your projects for other reasons, though.
Thanks! Understood.
Setting ResGenExecuteAsTool=true might work around the problem, by making the GenerateResource task run ResGen.exe as a child process instead of using cross-AppDomain remoting. It could be slower, though.
Will definitely take a look at this one. I've asked the folks to get me a bin log and we'll turn that option on and monitor.
I was able to open the binlogs on a 300 GB RAM machine and in the failure case it would timeout after about 8 minutes 20 seconds. In the successful case it would complete processing the resx files in 2 minutes 30 seconds. Our hardware is known to be extremely inconsistent, so at the moment we're leaning towards our build hardware or something about how the VMs were setup is causing severe instability that causes resx files to take longer to process and eventually timeout.
After taking a look at that we set ResGenExecuteAsTool=true
. It looks like it is solving our problem but we're only one day in, so I'll provide an update after the weekend to see if we still experience the issue.
Issue Description
We're running into an issue with a large .NET Framework project that runs into the following error intermittently:
This project is using the older csproj format and is on the larger side with a bunch of resource files. We've been struggling to determine how to figure out the root cause of the problem though. Anyone have ideas of what the issue is or what logs we can turn on to investigate further? We've turned on Roslyn compiler logs and didn't see anything too crazy to the untrained eye. This seems like a relevant issue but not a lot of content there: https://github.com/dotnet/msbuild/issues/6770
Steps to Reproduce
We can't provide reproduce steps unfortunately since we see it intermittently in a very large internal project.
Expected Behavior
We expect the compilation and the GenerateResource task to succeed.
Actual Behavior
The GenerateResource task will fail intermittently with an error that is a little difficult for those unfamiliar with MSbuild internals to understand.
Analysis
No response
Versions & Configurations
No response