BDN does not respect global.json (?)
We are using the prerelease of VS (Version 17.9.0 Preview 4.0). Our ennvironment is working with Directory.Build.props which was a problem for a longer time but has been solved recently. Now we wanted to give it another try, but now we are getting a problem with the prerelease. Although are global.json is set to not use prepreleases
{
"sdk": {
"allowPrerelease": false
}
}
We are getting this error:
MSBuild version 17.9.0-preview-23618-08+82d381eb2 for .NET
C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(311,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-po
According to some other post I updated the nuget source to the current upstream of BDN:
<add key="bdn-ci" value="https://ci.appveyor.com/nuget/benchmarkdotnet" />
Then I get:
MSBuild version 17.8.3+195e7f5a3 for .NET
which is a bit weird because I thought that if things are newer they can work with the newer version. But this is not my problem, the autogenerated project cannot be build.
CSC : error CS0006: Metadata file 'E:\TFS\IPIPE\_Build\obj\ipipe.Core.ArrayMaths.Benchmark\Release\ref\ipipe.Core.ArrayMaths.Benchmark.dll' could not be found [E:\TFS\IPIPE\_Build\Release\Assemblies\ipipe.Core.ArrayMaths.Benchmark\931474bc-6af3-4a5f-b1ed-f4f0043febe1\BenchmarkDotNet.Autogenerated.csproj]
But when go there and build the project manually with dotnet run/build it works.
Is there any suggestion?
@msedi Are you still able to repro? If so, could you share a repro project?
Hey @timcassell,
I ran into an issue related to the global.json file. I'm currently working on adding some benchmarks to the project:
https://github.com/scalar/scalar/tree/main/integrations/aspnetcore/playground/Scalar.AspNetCore.Benchmarks
When trying to run dotnet run -c Release, it initially failed. At first, I thought it might be due to the Directory.Build.props setup, but after some investigation, I found that the root cause was actually the global.json file. Once I deleted it, everything started working as expected. However, it then used the latest preview SDK, since global.json was no longer there.
Just wanted to flag this in case it’s helpful. I guess it's a different issue, so maybe it's worth creating another GitHub issue.
Let me know. I'm happy to open a new one.
I can't see your branch anymore (permanent links are usually better than branch links). Anyway, I'm not really sure what we can do here. We just invoke dotnet cli, which theoretically should just work. You could try passing the path to the exact sdk you want to use as a workaround --cli path/to/sdk (I haven't tried it so I'm not sure if it will work). I'm going to mark this issue up-for-grabs.
Thanks for the prompt reply. I apologize for the dead link, I didn't expect the PR to be merged so quickly 👀. Yeah, the issue itself is weird. The log is also empty. I'll look into this more thoroughly shortly.