2

I'm writing a .NET Core library which targets these frameworks:

"frameworks": {
  "netstandard1.3": {},
  "uap10.0": {
    "buildOptions": { "define": [ "UWP" ] }
  }
}

However, I can't declare the following (compiler error "Networking does not exist in Windows namepspace"):

#if UWP
using Windows.Networking;

Windows.Networking works in a UWP app for me but I can't achieve the same in multi-target .NET Core library. Adding Microsoft.NETCore.UniversalWindowsPlatform dependency changes nothing:

"frameworks": {
  "netstandard1.3": {},
  "uap10.0": {
    "dependencies": { "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2" },
    "buildOptions": { "define": [ "UWP" ] }
  }
}

What am I missing?

Alex
  • 2,469
  • 3
  • 28
  • 61
  • I ended up adding another UWP project, putting its csproj in the root of my project. Somehow, the same project.json worked fine for both .NET Core and UWP projects. http://stackoverflow.com/questions/41146301/can-two-project-json-files-share-the-same-codebase – Alex Dec 14 '16 at 17:36
  • So you have resolved your issue in another thread, right? – Sunteen Wu Dec 15 '16 at 06:29
  • Let's say, I managed to work around it. However, strictly speaking my current approach does not address the original question because I now have two projects instead of one. I'd better have a single .NET Core project with extra settings for UWP target. – Alex Dec 15 '16 at 08:27

0 Answers0