dotnet / crank

Benchmarking infrastructure for applications
MIT License
976 stars 103 forks source link

Remove redundant condition for NET 9 #754

Closed martincostello closed 1 month ago

martincostello commented 1 month ago

Remove now-redundant condition for .NET 9.

I was trying to run crank for a .NET 9 application and got this error:

[10:38:35 INF] Patching project file '/tmp/benchmarks-agent/benchmarks-server-2278/quz1y0ad.4mq/src/API/API.csproj'
[10:38:35 INF] Runtime:  (Current)
[10:38:35 INF] SDK:  (Current)
[10:38:35 INF] ASP.NET:  (Current)
[10:38:35 INF] Patching existing global.json file
[10:38:35 INF] An unexpected error occurred while building the job. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Crank.Agent.Startup.CloneRestoreAndBuild(String path, Job job, String dotnetHome, CancellationToken cancellationToken) in /_/src/Microsoft.Crank.Agent/Startup.cs:line 2855
   at Microsoft.Crank.Agent.Startup.<>c__DisplayClass85_3.<<ProcessJobs>b__22>d.MoveNext() in /_/src/Microsoft.Crank.Agent/Startup.cs:line 972
   --- End of inner exception stack trace ---

Tracing through the code, I found this leftover code from when net9.0 support was added prior to .NET 9 preview 1 shipping as part of #634.

martincostello commented 1 day ago

@sebastienros Would you be able to publish a new version of Crank to NuGet.org containing this change, or is there another feed for your CI I can use instead?

sebastienros commented 1 day ago

Updating right away, I don't do it quite often as I personally deploy from source. Good you reminded me.

sebastienros commented 1 day ago

Done

martincostello commented 1 day ago

Thank you!