How to generate service reference for .netstandard 2

182 Views Asked by At

We're migrating our codebase from .net framework to .net 7. To do so, we're converting our infrastructure projects (domain objects, business layer, data layer) to .netstandard 2 so that we can use it in both the old and new versions of the front end web applications while they're being migrated.

I need to generate service references in one of the .netstandard projects but when I try to add a new service under Manage Connected Services, I get the following error.

MSBuild version 17.4.0+18d5aef85 for .NET
C:\Users\geoff\.nuget\packages\system.runtime.compilerservices.unsafe\6.0.0\buildTransitive\netcoreapp2.0\System.Runtime.CompilerServices.Unsafe.targets(4,5): error : System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp3.1 or later. [C:\Users\geoff\AppData\Local\Temp\WCFConnectedService\2023_Jan_31_15_49_26\svcutil_bootstrap\SvcutilBootstrapper\SvcutilBootstrapper.csproj]

Build FAILED.

C:\Users\geoff\.nuget\packages\system.runtime.compilerservices.unsafe\6.0.0\buildTransitive\netcoreapp2.0\System.Runtime.CompilerServices.Unsafe.targets(4,5): error : System.Runtime.CompilerServices.Unsafe doesn't support netcoreapp2.0. Consider updating your TargetFramework to netcoreapp3.1 or later. [C:\Users\geoff\AppData\Local\Temp\WCFConnectedService\2023_Jan_31_15_49_26\svcutil_bootstrap\SvcutilBootstrapper\SvcutilBootstrapper.csproj]
    0 Warning(s)
    1 Error(s)

Any idea how I can get this working with the current .netstandard 2 setup?

0

There are 0 best solutions below