简体   繁体   English

是什么原因导致.net核心nuget包中出现不匹配,该包包含需要字典的抽象类

[英]What causes a mismatch in a .net core nuget package that contains an abstract class requiring a dictionary

I've setup a nuget package ( https://www.nuget.org/packages/AlexaCore/ ) that gets created via dotnet pack with parameters /p:Version=%system.build.number% driven off a TeamCity variable. 我已经设置了一个nuget包( https://www.nuget.org/packages/AlexaCore/ ),该文件是通过dotnet pack通过参数/p:Version=%system.build.number%从TeamCity变量中/p:Version=%system.build.number%而创建的。

When I reference the package in another .netcore1.0 application and create a new AlexaIntent Visual Studio 2017 doesn't persist the correct parameters on the GetResponseInternal method. 当我在另一个.netcore1.0应用程序中引用该程序包并创建新的AlexaIntent Visual Studio 2017不会在GetResponseInternal方法上保留正确的参数。 It should be: Dictionary<string, Slot> but defaults to GetResponseInternal(System.Collections.Generic.Dictionary slots) 它应该是: Dictionary<string, Slot>但默认为GetResponseInternal(System.Collections.Generic.Dictionary slots)

在此处输入图片说明

If I then correct the signature Visual Studio indicates the class doesn't correctly implement the base class: 如果随后我正确签名,则Visual Studio指示该类未正确实现基类:

在此处输入图片说明

Why might this be? 为什么会这样呢? Is the generation step invalid or somehow missing required settings. 生成步骤无效还是某种程度上缺少必需的设置。

FYI the Slot class exists in another package: Alexa.Net ( https://github.com/timheuer/alexa-skills-dotnet/tree/master/Alexa.NET ) which should be referenced by the nuget definition in my projects csproj file: 仅供参考, Slot类存在于另一个包中:Alexa.Net( https://github.com/timheuer/alexa-skills-dotnet/tree/master/Alexa.NET ),应在我的项目csproj文件中的nuget定义中引用该类:

<ItemGroup>
    <PackageReference Include="Alexa.NET" Version="1.0.2" />
    <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
  </ItemGroup>

If I reference the class library without nuget (ie via a project in the same solution) then the issue is not visible. 如果我引用没有nuget的类库(即通过相同解决方案中的项目),则该问题不可见。

Since updating to the latest version of Resharper (2017.2) this issue is no longer visible. 由于更新到最新版本的Resharper(2017.2),此问题不再可见。 I'd suggest doing the same. 我建议这样做。

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

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