- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 1k
 
Closed
Milestone
Description
Now that package references are copied into generated csproj (#2347), using variables there results in failure, because the variable is not available there.
One way to make it fail:
- Create a console app with some benchmarks.
 - Use this as a csproj (note the 
SomeVersionvariable). 
<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net7.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
	</PropertyGroup>
	<PropertyGroup>
		<SomeVersion>5.1.1</SomeVersion>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="BenchmarkDotNet" Version="0.13.7-nightly.20230713.34" />
		<PackageReference Include="Microsoft.Data.SqlClient" Version="$(SomeVersion)" />
	</ItemGroup>
</Project>Program.cs for completenes.
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            BenchmarkRunner.Run<Demo>();
        }
    }
    [ShortRunJob]
    public class Demo
    {
        [Benchmark]
        public void FooBar()
        {
            Microsoft.Data.SqlClient.SqlConnection.ClearAllPools();
        }
    }
}Metadata
Metadata
Assignees
Labels
No labels