首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Xamarin格式UWP未能引用NuGet软件包系统参考

Xamarin格式UWP未能引用NuGet软件包系统参考
EN

Stack Overflow用户
提问于 2017-04-25 08:54:52
回答 1查看 439关注 0票数 1

我正在尝试添加一个自制的NuGet包,它是用VisualStudio2017自动构建到一个UWP Xamarin窗体项目中的。

但是,当我尝试将包添加到UWP包(在VS2017包管理器中)时,它失败了。

代码语言:javascript
复制
Restoring packages for C:\Development\MyMobile\JobApp\JobApp\JobApp.UWP\project.json...
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm.
One or more packages are incompatible with UAP,Version=v10.0 (win10-arm).
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-arm-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-arm-aot).
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x64).
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x64-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x64-aot).
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x86).
System.Threading.ThreadPool 4.3.0 provides a compile-time reference assembly for System.Threading.ThreadPool on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
System.Threading.Thread 4.3.0 provides a compile-time reference assembly for System.Threading.Thread on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
System.Diagnostics.Process 4.3.0 provides a compile-time reference assembly for System.Diagnostics.Process on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
One or more packages are incompatible with UAP,Version=v10.0 (win10-x86-aot).
Package restore failed. Rolling back package changes for 'JobApp.UWP'.
Time Elapsed: 00:00:02.8217814
========== Finished ==========

我已经为UWP项目编辑了project.json,尝试并添加netstandard1.6 1.6和System.*依赖项,但遗憾的是,没有奏效。

代码语言:javascript
复制
{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.3",
    "MvvmLight": "5.3.0",
    "Newtonsoft.Json": "10.0.2",
    "Xamarin.Forms": "2.3.4.231",
    "System.Threading": "4.3.0",
    "System.Runtime": "4.3.0",
    "System.Diagnostics.Process": "4.3.0",
    "System.Threading.Thread": "4.3.0",
    "System.Threading.ThreadPool": "4.3.0"
  },
  "frameworks": {
    "uap10.0": {
      "imports": "netstandard1.6"
    }
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

为什么UWP在系统上有问题。*引用?

这是我的包裹的NuSpec;

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
    <metadata>
        <id>MyCommon</id>
        <version>1.0.131</version>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <dependencies>
            <group targetFramework=".NETFramework4.6">
                <dependency id="Quartz" version="3.0.0-alpha2" exclude="Build,Analyzers" />
                <dependency id="ImageSharp" version="1.0.0-alpha5-00046" exclude="Build,Analyzers" />
                <dependency id="System.ComponentModel" version="4.3.0" exclude="Build,Analyzers" />
            </group>
            <group targetFramework=".NETStandard1.6">
                <dependency id="Quartz" version="3.0.0-alpha2" exclude="Build,Analyzers" />
                <dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
                <dependency id="ImageSharp" version="1.0.0-alpha5-00046" exclude="Build,Analyzers" />
                <dependency id="System.ComponentModel" version="4.3.0" exclude="Build,Analyzers" />
            </group>
        </dependencies>
    </metadata>
</package>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-07 03:51:51

您的NuGet包引用的是Quartz 3.0.0-alpha2,它引用System.Threading.ThreadSystem.Threading.ThreadPool

这两个包(System.Threading.ThreadSystem.Threading.ThreadPool)在通用Windows平台上不受支持,至少目前不支持。

这里,Immo ( .NET团队的项目经理)说:

  • UWP目前只支持.NET标准1.4
  • 我们的目标是最终扩展UWP以实现.NET标准2.0。一旦发生这种情况,UWP也将支持Thread

下面是一些GitHub问题,您可以在这里更多地阅读有关此主题的内容:

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43605946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档