Is it possible to load a referenced assembly only if the .NET Framework version is lesser than a specific number ?
I'm using a selfmade LINQ library on .NET 2.0, but if the framework is 3.5+, it should use the M$ LINQ library, and ignore the selfmade one.
Edit:
Here's my library:
http://linq4you.codeplex.com/
Yes, you can do that by modifying your project file.
Open your csproj file in a text-editor, and find the line in the project file that describes the dependency that you want to conditionally load, and make sure that it looks like this, for instance:
<Reference Include="LinqBridge" Condition="$(TargetFrameworkVersion)=='v2.0'">
<HintPath>..\..\..\DevSupport\Lib\LinqBridge\LinqBridge.dll</HintPath>
<Private>True</Private>
</Reference>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With