简体   繁体   English

UWP应用程序和.NET Core RC2:不能引用netstandard1.4软件包

[英]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. 我有一个场景,我使用共享代码库运行UWP客户端应用程序,UWP IOT应用程序和.NET Core应用程序。 In .NET Core RC1 I built a Class Library (Package) and used "dotnet5.4" as the base framework for that library. 在.NET Core RC1中,我构建了一个类库(Package),并使用“dotnet5.4”作为该库的基础框架。

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. 使用“生成构建输出”我可以从.NET Core应用程序(控制台)引用创建的nuget包并使用解决方法(从%local%.dnx - >%local%.nuget复制包)UWP应用程序能够参考并使用该包。

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. 现在在RC2中,事情发生了一些变化,我再次能够使用已升级的库(在项目文件中升级的工具,更改为project.json,netstandard1.4(因为1.5根据不能与UAP10一起使用))完美地使用.NET Core控制台应用程序。

For UWP I cannot add the library since I get dozens of infamous 对于UWP我无法添加库,因为我得到了几十个臭名昭着的

"[...] 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的引用,原因如下:

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 . 我有一个最小的解决方案来重现上传到OneDrive的问题。

I made no changes to the blank UWP template except for the dependencies in project.json: 除了project.json中的依赖项之外,我没有对空白UWP模板进行任何更改:

"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. 注意:我将Microsoft.NETCore.UniversalWindowsPlatform更新到最新版本。 I added NETStandard.Library and Microsoft.NETCore.Platforms. 我添加了NETStandard.Library和Microsoft.NETCore.Platforms。

Help is greatly appreciated! 非常感谢帮助! Thanks in advance -Simon 提前谢谢 - 西蒙

System.IO.FileSystem.Watcher isn't currently supported in UWP. UWP目前不支持System.IO.FileSystem.Watcher。 The modern SDK doesn't expose the underlying windows API (ReadDirectoryChanges) that we need to implement it. 现代SDK不公开我们需要实现它的底层Windows API(ReadDirectoryChanges)。

-Eric, .NET team -Eric,.NET团队

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM