Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

291 Added backwards compatibility #303

Merged

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
1 check passed
@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