C
C#2mo ago
lsass

Reference a higher version of System.Runtime

Hello everyone, I'm making a .NET Framework (v4.8) and C# (v8.0) class library, I'm also using a library which requires me to reference System.Runtime 7.0.0.0 (while currently there is a v4.1.2.0 reference), which I'm clueless on how to do, any help is appreciated!
4 Replies
Pobiega
Pobiega2mo ago
If you are targetting both 4.8 and 8.0, that would mean you need to target .net standard 2.0 assuming you want the exact same codebase to work for both in a single library
lsass
lsass2mo ago
well, how exactly could i do that? changing the target framework in my .csproj to netstandard2.0 breaks (doesn't want to load the project), do i need to download it as an individulal component from the installer?
reflectronic
reflectronic2mo ago
System.Runtime 7.0.0.0 means that the library is compiled for .NET 7 you may not use a library compiled for .NET 7 from .NET Framework 4.8
Pobiega
Pobiega2mo ago
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
is the bare minimum csproj file for a netstandard2.0 shouldnt need anything else afaik
Want results from more Discord servers?
Add your server
More Posts