Skip to content

291 Added backwards compatibility#303

Merged
ardalis merged 2 commits intoardalis:mainfrom
Marvin-Brouwer:291-caller-argument-expression-net6
Nov 9, 2023
Merged

291 Added backwards compatibility#303
ardalis merged 2 commits intoardalis:mainfrom
Marvin-Brouwer:291-caller-argument-expression-net6

Conversation

@Marvin-Brouwer
Copy link
Contributor

Fixes #291.

To test this I referenced this project directly, in a multi target project, like so:

	<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
		<Reference Include="Ardalis.GuardClauses">
			<HintPath>..\..\..\GuardClauses\src\GuardClauses\bin\Release\net7.0\Ardalis.GuardClauses.dll</HintPath>
		</Reference>
	</ItemGroup>
	<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
		<Reference Include="Ardalis.GuardClauses">
			<HintPath>..\..\..\GuardClauses\src\GuardClauses\bin\Release\netstandard2.1\Ardalis.GuardClauses.dll</HintPath>
		</Reference>
	</ItemGroup>
	<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
		<Reference Include="Ardalis.GuardClauses">
			<HintPath>..\..\..\GuardClauses\src\GuardClauses\bin\Release\netstandard2.1\Ardalis.GuardClauses.dll</HintPath>
		</Reference>
	</ItemGroup>
	<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
		<Reference Include="Ardalis.GuardClauses">
			<HintPath>..\..\..\GuardClauses\src\GuardClauses\bin\Release\netstandard2.0\Ardalis.GuardClauses.dll</HintPath>
		</Reference>
	</ItemGroup>

I changed one of my unit-test that validated a Guard.Against.Null(...); into net6.0 and stepped into a test. It did automatically resolve the parameterName in Lang version 10.

Feel free to validate this locally before approving.

@ardalis
Copy link
Owner

ardalis commented Oct 18, 2023

Cool, thanks! I'll try to make time to try this out soon. Pretty overwhelmed at the moment.

@ardalis ardalis merged commit 9ad94de into ardalis:main Nov 9, 2023
@Marvin-Brouwer Marvin-Brouwer deleted the 291-caller-argument-expression-net6 branch November 9, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CallerArgumentExpression No Longer Working When Targeting net6.0

2 participants