0

I've a multi target C# dotnet project with these frameworks defined in the csproj file:

<TargetFrameworks>net451;net452;net46;net461;netstandard1.3;netstandard2.0</TargetFrameworks>

However when browsing the source code, I get lot of errors like: enter image description here

Which is strange because I use the correct preprocessor defines like:

#if NET452
using Microsoft.Owin;
#else
using Microsoft.AspNetCore.Http;
#endif

Is this even possible in Visual Studio Code ?

Edit...

Using Visual Studio 2019, the project builds fine and I can use this framework dropdown like this: enter image description here

Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121
  • what you did here is only the using statement. you need to do special processing for the dll reference (import) as well (never done it. would assume its going to be a pain in the ass too). and who is setting that NET452 macro? – Steve Feb 12 '20 at 21:13
  • The full project can be found here: https://github.com/WireMock-Net/WireMock.Net/tree/master/test/WireMock.Net.Tests Maybe that helps understanding what I try to do. – Stef Heyenrath Feb 12 '20 at 21:22

0 Answers0