Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP application and .NET Core RC2: cannot reference netstandard1.4 packages

I have a scenario where I run a UWP client application, a UWP IOT application and a .NET Core application using a shared code base. In .NET Core RC1 I built a Class Library (Package) and used "dotnet5.4" as the base framework for that library.

Using "generate build output" I could reference the created nuget packages from the .NET Core application (console) and using a workaround (copy the packages from %local%.dnx -> %local%.nuget) the UWP applications were able to reference and use the package as well.

Now in RC2 things have changed a bit and I am again able to consume the upgraded library (tooling upgraded in project file, changes to project.json, netstandard1.4 (since 1.5 does not work with UAP10 according to this)) perfectly using the .NET Core console application.

For UWP I cannot add the library since I get dozens of infamous

"[...] provides a compile-time reference assembly [...] but there is no run-time assembly compatible with [...]"

errors.

After some looking around, I tried to isolate the issue and found out that I can't even add a reference to System.IO.FileSystem.Watcher due to:

System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
Some packages are not compatible with UAP,Version=v10.0 (win10-x64-aot).
System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64.
Some packages are not compatible with UAP,Version=v10.0 (win10-arm).
Some packages are not compatible with UAP,Version=v10.0 (win10-x86-aot).
System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.
System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm.
Some packages are not compatible with UAP,Version=v10.0 (win10-x64).
System.IO.FileSystem.Watcher 4.0.0-rc2-24027 provides a compile-time reference assembly for System.IO.FileSystem.Watcher on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
Some packages are not compatible with UAP,Version=v10.0 (win10-x86).
Some packages are not compatible with UAP,Version=v10.0 (win10-arm-aot).

I have a minimal solution to reproduce the issue uploaded to OneDrive.

I made no changes to the blank UWP template except for the dependencies in project.json:

"dependencies":
{
    "Microsoft.ApplicationInsights": "2.1.0-beta4",
    "Microsoft.ApplicationInsights.PersistenceChannel": "2.0.0-beta3",
    "Microsoft.ApplicationInsights.WindowsApps": "1.1.1",
    "Microsoft.NETCore.Platforms": "1.0.1-rc2-24027",
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0",
    "NETStandard.Library": "1.5.0-rc2-24027",

    "System.IO.FileSystem.Watcher": "4.0.0-rc2-24027"
},

Note: I updated Microsoft.NETCore.UniversalWindowsPlatform to the latest version. I added NETStandard.Library and Microsoft.NETCore.Platforms.

Help is greatly appreciated! Thanks in advance -Simon

like image 831
Simon Mattes Avatar asked May 21 '16 16:05

Simon Mattes


1 Answers

System.IO.FileSystem.Watcher isn't currently supported in UWP. The modern SDK doesn't expose the underlying windows API (ReadDirectoryChanges) that we need to implement it.

-Eric, .NET team

like image 129
TheESJ Avatar answered Oct 19 '22 06:10

TheESJ