Closed WenJunJi01 closed 1 year ago
Looks like an MSBuild issue based on output: "[MSBuild]::GetTargetFrameworkIdentifier(netcoreapp3.1)"
.
cc @dsplaisted @marcpopMSFT @rainersigwald Do you know who to root this issue to?
@BenVillalobos can you check this since it's ARM related? It looks like the property function is blowing up?
I have the same error with SDK 7.0.100-preview.6.22306.1
but not with SDK 7.0.100-preview.6.22302.2
This is high pri on my radar. Looks like it should be an easy repro
Note to self: Maybe we can improve logging here.
This is a heck of a bug. There's something going on with that x86 dotnet install. I could repro this issue, and discovered a fatal error in the process. Both issues only repro in that x86 dotnet install.
Here's a stack trace I got from the repro:
PS D:\src\mstest> & “C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --diag:logna.txt
Determining projects to restore...
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFramewo
rkInference.targets(55,5): error MSB4184: The expression "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be ev
aluated. Exception has been thrown by the target of an invocation. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1026,7): error MSB4018: The "MSBuild" task f
ailed unexpectedly. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1026,7): error MSB4018: System.NullReference
Exception: Object reference not set to an instance of an object. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1026,7): error MSB4018: at InvokeStub_MSB
uild.get_TargetOutputs(Object, Object, IntPtr*) [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1026,7): error MSB4018: at System.Reflect
ion.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1026,7): error MSB4028: The "MSBuild" task's
outputs could not be retrieved from the "TargetOutputs" parameter. Object reference not set to an instance of an objec
t. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1123,7): error MSB4018: The "MSBuild" task f
ailed unexpectedly. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1123,7): error MSB4018: System.NullReference
Exception: Object reference not set to an instance of an object. [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1123,7): error MSB4018: at InvokeStub_MSB
uild.get_TargetOutputs(Object, Object, IntPtr*) [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1123,7): error MSB4018: at System.Reflect
ion.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) [D:\src\mstest\mstest.csproj]
C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.6.22315.18\NuGet.targets(1123,7): error MSB4028: The "MSBuild" task's
outputs could not be retrieved from the "TargetOutputs" parameter. Object reference not set to an instance of an objec
t. [D:\src\mstest\mstest.csproj]
I think there's a larger issue here WRT x86 dotnet on arm64 machines. I haven't tested this on a non-arm64 machine yet. You can easily repro it (only on x86) with an empty project:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
</Project>
Here's the fatal error:
Fatal error. 0xC0000005
at DynamicClass.Regex1_Scan(System.Text.RegularExpressions.RegexRunner, System.ReadOnlySpan`1<Char>)
at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[[System.ValueTuple`5[[System.Text.SegmentStringBuilder, System.Text.RegularExpressions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.String, Int32, System.ValueTuple`5<System.Text.SegmentStringBuilder,System.__Canon,Int32,System.__Canon,Int32> ByRef, System.Text.RegularExpressions.MatchCallback`1<System.ValueTuple`5<System.Text.SegmentStringBuilder,System.__Canon,Int32,System.__Canon,Int32>>, System.Text.RegularExpressions.RegexRunnerMode, Boolean)
at System.Text.RegularExpressions.Regex.Replace(System.Text.RegularExpressions.MatchEvaluator, System.Text.RegularExpressions.Regex, System.String, Int32, Int32)
at System.Text.RegularExpressions.Regex.Replace(System.String, System.Text.RegularExpressions.MatchEvaluator)
at Microsoft.Build.Evaluation.Expander`2+MetadataExpander[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExpandMetadataLeaveEscaped(System.String, Microsoft.Build.Evaluation.IMetadataTable, Microsoft.Build.Evaluation.ExpanderOptions, Microsoft.Build.Shared.IElementLocation)
at Microsoft.Build.Evaluation.Expander`2[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExpandIntoStringLeaveEscaped(System.String, Microsoft.Build.Evaluation.ExpanderOptions, Microsoft.Build.Shared.IElementLocation)
at Microsoft.Build.Evaluation.ConditionEvaluator+ConditionEvaluationState`2[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExpandIntoStringBreakEarly(System.String)
at Microsoft.Build.Evaluation.StringExpressionNode.EvaluatesToEmpty(IConditi
onEvaluationState)
at Microsoft.Build.Evaluation.MultipleComparisonNode.BoolEvaluate(IConditionEvaluationState)
at Microsoft.Build.Evaluation.OperatorExpressionNode.TryBoolEvaluate(IConditionEvaluationState, Boolean ByRef)
at Microsoft.Build.Evaluation.AndExpressionNode.BoolEvaluate(IConditionEvaluationState)
at Microsoft.Build.Evaluation.OperatorExpressionNode.TryBoolEvaluate(IConditionEvaluationState, Boolean ByRef)
at Microsoft.Build.Evaluation.AndExpressionNode.BoolEvaluate(IConditionEvaluationState)
at Microsoft.Build.Evaluation.OperatorExpressionNode.TryBoolEvaluate(IConditionEvaluationState, Boolean ByRef)
at Microsoft.Build.Evaluation.AndExpressionNode.BoolEvaluate(IConditionEvaluationState)
at Microsoft.Build.Evaluation.OperatorExpressionNode.TryBoolEvaluate(IConditionEvaluationState, Boolean ByRef)
at Microsoft.Build.Evaluation.GenericExpressionNode.Evaluate(IConditionEvaluationState)
at Microsoft.Build.Evaluation.ConditionEvaluator.EvaluateConditionCollectingConditionedProperties[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.String, Microsoft.Build.Evaluation.ParserOptions, Microsoft.Build.Evaluation.Expander`2<System.__Canon,System.__Canon>, Microsoft.Build.Evaluation.ExpanderOptions, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<System.String>>, System.String, Microsoft.Build.Construction.ElementLocation, Microsoft.Build.BackEnd.Logging.ILoggingService, Microsoft.Build.Framework.BuildEventContext, Microsoft.Build.Shared.FileSystem.IFileSystem, Microsoft.Build.Evaluation.ProjectRootElementCacheBase)
at Microsoft.Build.BackEnd.ItemGroupIntrinsicTask.ExecuteTask(Microsoft.Build.BackEnd.Lookup)
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteIntrinsicTask(Microsoft.Build.BackEnd.ItemBucket)
at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteBucket>d__19.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteBucket>d__19, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteBucket>d__19 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteBucket>d__19, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteBucket>d__19 ByRef)
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteBucket(Microsoft.Build.BackEnd.TaskHost, Microsoft.Build.BackEnd.ItemBucket, Microsoft.Build.BackEnd.TaskExecutionMode, System.Collections.Generic.Dictionary`2<System.String,System.String>)
at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__18.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__18, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTask>d__18 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__18, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTask>d__18 ByRef)
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(Microsoft.Build.BackEnd.TaskExecutionMode, Microsoft.Build.BackEnd.Lookup)
at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__13.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__13, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTask>d__13 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TaskBuilder+<ExecuteTask>d__13, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTask>d__13 ByRef)
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(Microsoft.Build.BackEnd.Logging.TargetLoggingContext, Microsoft.Build.BackEnd.BuildRequestEntry, Microsoft.Build.BackEnd.ITargetBuilderCallback, Microsoft.Build.Execution.ProjectTargetInstanceChild, Microsoft.Build.BackEnd.TaskExecutionMode, Microsoft.Build.BackEnd.Lookup, Microsoft.Build.BackEnd.Lookup, System.Threading.CancellationToken)
at Microsoft.Build.BackEnd.TargetEntry+<ProcessBucket>d__51.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TargetEntry+<ProcessBucket>d__51, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ProcessBucket>d__51 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TargetEntry+<ProcessBucket>d__51, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ProcessBucket>d__51 ByRef)
at Microsoft.Build.BackEnd.TargetEntry.ProcessBucket(Microsoft.Build.BackEnd.ITaskBuilder, Microsoft.Build.BackEnd.Logging.TargetLoggingContext, Microsoft.Build.BackEnd.TaskExecutionMode, Microsoft.Build.BackEnd.Lookup, Microsoft.Build.BackEnd.Lookup)
at Microsoft.Build.BackEnd.TargetEntry+<ExecuteTarget>d__44.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TargetEntry+<ExecuteTarget>d__44, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTarget>d__44 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.TargetEntry+<ExecuteTarget>d__44, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ExecuteTarget>d__44 ByRef)
at Microsoft.Build.BackEnd.TargetEntry.ExecuteTarget(Microsoft.Build.BackEnd.ITaskBuilder, Microsoft.Build.BackEnd.BuildRequestEntry, Microsoft.Build.BackEnd.Logging.ProjectLoggingContext, System.Threading.CancellationToken)
at Microsoft.Build.BackEnd.TargetBuilder+<ProcessTargetStack>d__23.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TargetBuilder+<ProcessTargetStack>d__23, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ProcessTargetStack>d__23 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.TargetBuilder+<ProcessTargetStack>d__23, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<ProcessTargetStack>d__23 ByRef)
at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(Microsoft.Build.BackEnd.ITaskBuilder)
at Microsoft.Build.BackEnd.TargetBuilder+<BuildTargets>d__10.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.TargetBuilder+<BuildTargets>d__10, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildTargets>d__10 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.TargetBuilder+<BuildTargets>d__10, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildTargets>d__10 ByRef)
at Microsoft.Build.BackEnd.TargetBuilder.BuildTargets(Microsoft.Build.BackEnd.Logging.ProjectLoggingContext, Microsoft.Build.BackEnd.BuildRequestEntry, Microsoft.Build.BackEnd.IRequestBuilderCallback, System.String[], Microsoft.Build.BackEnd.Lookup, System.Threading.CancellationToken)
at Microsoft.Build.BackEnd.RequestBuilder+<BuildProject>d__68.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildProject>d__68, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildProject>d__68 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildProject>d__68, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildProject>d__68 ByRef)
at Microsoft.Build.BackEnd.RequestBuilder.BuildProject()
at Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildAndReport>d__59 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.RequestBuilder+<BuildAndReport>d__59, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<BuildAndReport>d__59 ByRef)
at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport()
at Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<RequestThreadProc>d__58 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.Build.BackEnd.RequestBuilder+<RequestThreadProc>d__58, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<RequestThreadProc>d__58 ByRef)
at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean)
at Microsoft.Build.BackEnd.RequestBuilder.<StartBuilderThread>b__53_2()
at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
at System.Threading.Tasks.Task+<>c.<.cctor>b__273_0(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.Tasks.Task.ExecuteEntry()
at System.Threading.Tasks.TaskScheduler.TryExecuteTask(System.Threading.Tasks.Task)
at Microsoft.Build.BackEnd.RequestBuilder+DedicatedThreadsTaskScheduler.<InjectThread>b__6_0()
at System.Threading.Thread+StartHelper.Callback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Thread.StartCallback()
I captured a log (and removed env vars), it should be attached. It ends abruptly and there's no obvious sign at first glance at what's going on. Will get back to this tomorrow
@BenVillalobos drive-by question: have you tried with a 6.0.400-preview SDK that has the latest MSBuild bits in it? some of that looks like it might be a runtime problem.
drive-by question: have you tried with a 6.0.400-preview SDK that has the latest MSBuild bits in it? some of that looks like it might be a runtime problem.
After installing 6.0.400-preview.22316.6
the fatal error issue...disappeared 😐
Scratch that. (had to re-include the .net sdk into the project).
The fatal error does not come up in 6.0.400-preview.22316.6 and does come up in 7.0.100-preview.5.22307.18 (global jsoning the project between versions)
D:\src\temp\repro-tfi>"C:\Program Files (x86)\dotnet\dotnet.exe" build /flp:v=diag
MSBuild version 17.3.0-preview-22306-01+1c045cf58 for .NET
Determining projects to restore...
C:\Program Files (x86)\dotnet\sdk\6.0.400-preview.22316.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkI
nference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NE
T 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\src\temp\repro-tfi\proj.csproj]
Build FAILED.
C:\Program Files (x86)\dotnet\sdk\6.0.400-preview.22316.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkI
nference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0. Either target .NE
T 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [D:\src\temp\repro-tfi\proj.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:06.88
D:\src\temp\repro-tfi>"C:\Program Files (x86)\dotnet\dotnet.exe" build /flp:v=diag
MSBuild version 17.3.0-preview-22306-01+1c045cf58 for .NET
Fatal error. 0xC0000005
at DynamicClass.Regex1_Scan(System.Text.RegularExpressions.RegexRunner, System.ReadOnlySpan`1<Char>)
at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[[System.ValueTuple`5[[System.Text.SegmentStringBuilder, System.Text.RegularExpressions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Privat
...
...
6.0.400 successfully repro's this issue, so I can continue the investigation tomorrow. The 7.0.100 looks to have a bigger issue in there.
Currently discussing this internally, but it looks like an issue with the runtime.
Transferring to runtime for triage.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
As the stack suggests, it's executing ref-emitted code here. The regex is either NonTransformItemMetadataPattern or ItemMetadataPattern. So main possibilities are - a bug introduced into the compiled regex engine or a bug in the runtime. Either way, that's showing up only when in 32 bit x86 running on Windows Arm64.
@BenVillalobos since you have a machine set up that repros this, is it possible to dump (out of the debugger) both the regex pattern, regex options, and the string it's running on? Then paste those into a Hello World app to see whether just running that pattern against that string triggers it. If so -- we've substantially narrowed this down.
This issue also repro on dotnet-sdk-7.0.100-preview.7.22358.13. Command: & “C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --diag:logna.txt & "C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch x64 --diag:logz2.txt & "C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch arm64 --diag:logz2.txt
PS C:\tmp\mstest> & "C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch x64 --diag:logz2.txt Determining projects to restore... C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(55,5): error MSB4184: The expres sion "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be evaluated. Exception has been thrown by the target of an invocation. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: The "MSBuild" task failed unexpectedly. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: System.NullReferenceException: Object reference not set to an instance o f an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: at InvokeStub_MSBuild.get_TargetOutputs(Object, Object, IntPtr) [C:\ tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, B indingFlags invokeAttr) [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4028: The "MSBuild" task's outputs could not be retrieved from the "TargetOutp uts" parameter. Object reference not set to an instance of an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: The "MSBuild" task failed unexpectedly. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: System.NullReferenceException: Object reference not set to an instance o f an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: at InvokeStub_MSBuild.get_TargetOutputs(Object, Object, IntPtr) [C:\ tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, B indingFlags invokeAttr) [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4028: The "MSBuild" task's outputs could not be retrieved from the "TargetOutp uts" parameter. Object reference not set to an instance of an object. [C:\tmp\mstest\mstest.csproj] PS C:\tmp\mstest> & "C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch arm64 --diag:logz2.txt Determining projects to restore... C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: The "MSBuild" task failed unexpectedly. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: System.NullReferenceException: Object reference not set to an instance o f an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: at InvokeStub_MSBuild.get_TargetOutputs(Object, Object, IntPtr) [C:\ tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, B indingFlags invokeAttr) [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1111,7): error MSB4028: The "MSBuild" task's outputs could not be retrieved from the "TargetOutp uts" parameter. Object reference not set to an instance of an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: The "MSBuild" task failed unexpectedly. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: System.NullReferenceException: Object reference not set to an instance o f an object. [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: at InvokeStub_MSBuild.get_TargetOutputs(Object, Object, IntPtr) [C:\ tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4018: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, B indingFlags invokeAttr) [C:\tmp\mstest\mstest.csproj] C:\Program Files (x86)\dotnet\sdk\7.0.100-preview.7.22358.13\NuGet.targets(1208,7): error MSB4028: The "MSBuild" task's outputs could not be retrieved from the "TargetOutp uts" parameter. Object reference not set to an instance of an object. [C:\tmp\mstest\mstest.csproj] PS C:\tmp\mstest>
Does this only repro with x86 emulation on arm64? There was a recent fix which was made recently for that.
This issue still repro on today's dotnet-sdk-7.0.100-rc.1.22377.7.
Does this only repro with x86 emulation on arm64? --Yes. For the x64 emulation on arm64, there's another issue https://github.com/dotnet/msbuild/issues/7721 to track.
If this is emulation only then its most likely a dupe of https://github.com/dotnet/runtime/issues/71856.
A similar issue is closed: #71856, Please validate that this is now fixed.
This issue still repro on today's build dotnet-sdk-7.0.100-rc.1.22403.8. Here is the repro VM: 172.20.30.177
Please refer to the project & dump file from: \mlangfs1\public\v-hozha1\20220804-71098\
PS C:\tmp\mstest> &"C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --diag:log1.txt Determining projects to restore... C:\Program Files (x86)\dotnet\sdk\7.0.100-rc.1.22403.8\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(55,5): error MSB4184: The expression "[MSBuild]::GetTargetFrameworkVersion(net7.0, 2)" cannot be evalua ted. Exception has been thrown by the target of an invocation. [C:\tmp\mstest\mstest.csproj] PS C:\tmp\mstest> &"C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch x64 --diag:log2.txt Determining projects to restore... Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at InvokeStub_IntrinsicFunctions.IsOSPlatform(Object, Object, IntPtr) PS C:\tmp\mstest> &"C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --arch arm64 --diag:log3.txt Determining projects to restore... Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at InvokeStub_CheckIfPackageReferenceShouldBeFrameworkReference.get_ShouldRemovePackageReference(Object, Object, IntPtr) PS C:\tmp\mstest>
the fix should be in runtime 7.0.0-rc.1.22403.8 and sdk 7.0.100-rc.1.22404.5
Closing since this should be fixed.
This issue has been fixed on dotnet-sdk-7.0.100-rc.1.22414.7. Details please refer to below:
Note: 1.It’s regression issue. It doesn’t repro on dotnet-sdk-7.0.100-preview.5.22225.1-win-arm64.
Builds info: dotnet-runtime-3.1.26-win-x64 dotnet-sdk-6.0.400-preview.22314.17-win-x64 dotnet-sdk-7.0.100-preview.6.22314.18-win-arm64 dotnet-sdk-7.0.100-preview.6.22314.18-win-x64 dotnet-sdk-7.0.100-preview.6.22314.18-win-x86
Build Link: https://aka.ms/dotnet/7.0.1xx/daily/dotnet-sdk-win-arm64.exe https://aka.ms/dotnet/7.0.1xx/daily/dotnet-sdk-win-x64.exe https://aka.ms/dotnet/7.0.1xx/daily/dotnet-sdk-win-x86.exe https://aka.ms/dotnet/6.0.4xx/daily/dotnet-sdk-win-x64.exe https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-3.1.26-windows-x64-installer
Steps: Execute the following commands by Powershell: 1) $env:DOTNET_MULTILEVEL_LOOKUP=0 2) ls env: 3) dotnet new mstest 4) Update file UnitTest1.cs with
Update the project file in in this way
5) dotnet test --framework net7.0 --diag:loga.txt 6) &"C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --diag:logna.txt
Expected Result: The command should be run normally as following:
Actual Results: Fail to run the command – & “C:\Program Files (x86)\dotnet\dotnet.exe" test --framework net7.0 --diag:logna.txt
--Log: