C
C#

help

dotnet6 project failing on static abstracts with preview features set to true

JJayy8/14/2022
C:\Users\Kellen James\source\Repos\ClemBot\ClemBot.Api\ClemBot.Api.Core\Features\Tags\Edit.cs(51,49): error CS8920: The
interface 'IQueryResult<Edit.TagDto>' cannot be used as type argument. Static member 'IQueryResult<Edit.TagDto>.Succes
s(Edit.TagDto?)' does not have a most specific implementation in the interface. [C:\Users\Kellen James\source\Repos\Cle
mBot\ClemBot.Api\ClemBot.Api.Core\ClemBot.Api.Core.csproj]
C:\Users\Kellen James\source\Repos\ClemBot\ClemBot.Api\ClemBot.Api.Core\Features\Tags\SetCustomTagPrefix.cs(31,48): err
or CS8920: The interface 'IQueryResult<ulong>' cannot be used as type argument. Static member 'IQueryResult<ulong>.Succ
ess(ulong)' does not have a most specific implementation in the interface. [C:\Users\Kellen James\source\Repos\ClemBot\
ClemBot.Api\ClemBot.Api.Core\ClemBot.Api.Core.csproj]
4 Warning(s)
261 Error(s)
C:\Users\Kellen James\source\Repos\ClemBot\ClemBot.Api\ClemBot.Api.Core\Features\Tags\Edit.cs(51,49): error CS8920: The
interface 'IQueryResult<Edit.TagDto>' cannot be used as type argument. Static member 'IQueryResult<Edit.TagDto>.Succes
s(Edit.TagDto?)' does not have a most specific implementation in the interface. [C:\Users\Kellen James\source\Repos\Cle
mBot\ClemBot.Api\ClemBot.Api.Core\ClemBot.Api.Core.csproj]
C:\Users\Kellen James\source\Repos\ClemBot\ClemBot.Api\ClemBot.Api.Core\Features\Tags\SetCustomTagPrefix.cs(31,48): err
or CS8920: The interface 'IQueryResult<ulong>' cannot be used as type argument. Static member 'IQueryResult<ulong>.Succ
ess(ulong)' does not have a most specific implementation in the interface. [C:\Users\Kellen James\source\Repos\ClemBot\
ClemBot.Api\ClemBot.Api.Core\ClemBot.Api.Core.csproj]
4 Warning(s)
261 Error(s)
I am seeing this error attempting to use static abstracts in a .net 6 project this code works on other peoples machines fine, its on a 6.0.400 install of dotnet cc @tannergooding maybe? Static abstracts are sorta your wheel house
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<LangVersion>preview</LangVersion>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<LangVersion>preview</LangVersion>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
</PropertyGroup>
csproj
Ttannergooding8/14/2022
.net 6 has many limitations as not all runtime support is ghere Also going camping until Wednesday, so little internet
JJayy8/14/2022
ahh ok, have fun ohh wow ok, so i upgraded my sdk from 6.0.1 -> 6.0.4 and it started failing for me fascinating this feels like a bug
F333fred8/14/2022
Show code, but likely not a bug
F333fred8/14/2022
GitHub
Disallow interfaces with static virtual members as type arguments ·...
This proposal attempts to address a type hole that has been pointed out a number of times with static virtual members, e.g. here. Static virtual members (Proposal: static-abstracts-in-interfaces.md...
JJayy8/14/2022
did this ship 5 days ago as part of 6.0.8 of the runtime?
F333fred8/14/2022
Wouldn't surprise me
JJayy8/14/2022
thats fantastic lol -_- and code is this
public interface IQueryResult<T> : IResult<T, QueryStatus>
{
static abstract IQueryResult<T> Success(T? val);
static abstract IQueryResult<T> Invalid(T? val);
static abstract IQueryResult<T> NotFound();
static abstract IQueryResult<T> Conflict();
static abstract IQueryResult<T> Forbidden();
}
public interface IQueryResult<T> : IResult<T, QueryStatus>
{
static abstract IQueryResult<T> Success(T? val);
static abstract IQueryResult<T> Invalid(T? val);
static abstract IQueryResult<T> NotFound();
static abstract IQueryResult<T> Conflict();
static abstract IQueryResult<T> Forbidden();
}
PPatrick8/14/2022
for a moment i thought you had lied to us all about your name
JJayy8/14/2022
public class Handler(ClemBotContext _context) : IRequestHandler<Command, IQueryResult<Model>>
{
}
public class Handler(ClemBotContext _context) : IRequestHandler<Command, IQueryResult<Model>>
{
}
JJayy8/14/2022
ree
JJayy8/14/2022
this is quite unfortunate i am going to have to rewrite... everything for this and i cant write a conversion cuz its an interface ree

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
I need to serialize a bunch of non-primitive types. How would I do this?I'm using JsonSerializer.serializeToUtf8Bytes I need to serialize a class that contains a bitmap, anWhen to use ValueTask?Despite having used C# for a while I'm... not *that* familiar with async. I know people sometimes saHow would you design a solution to this problem?unsure what would be the best approach - I have a SQL table that stores SMS 3rd party providers. EWrite a String manipulation program [Answered]I have two strings. One of them contains completely the entire other string. While that other stringC++ Interop - writing a shim to use an existing c++ library [Answered]So I'm currently trying to make a shim for a C++ library that I can then call from C#. The original Are there dedicated .net framework or ASP discords? [Answered]Are there dedicated .net framework or ASP discords? If so pls link 😳How to get these values from the dynamic json object ?I wanna assign the values for id and password to strings so I'll have something to work with after tHow to convert bitmap to 1 bit byte array?I generated a barcode with ZXing.Mobile.Net and intend to print it to a thermal via bluetooth... SeBackground Opacity in WinFromsI'm trying to create a simple two-layered click-through program in Windows Forms which has a semi-tr[FromForm] isn't available in .NET 6 for minimal API.Is there any way to make a MapPost() receive parameters from encoded form ?Display user data after loginHey Guys, I am trying to show data of a customer after login. The problem is that I always get to sHow can I modify array values in a for loop ? [Answered]Hello, I wanted to do a piece of code that replaces half of the words inserted by the user (in a ranWhich UI?Hey Guys, since it seems to be impossible from an Console App to get an Discord Authentication i wiHow should I approach learning backend webdev as a novice? [Answered]I'm a novice who only has the basic fundamentals and OOP (console apps and some unity only) and i'veC delegatesC# delegates: I know that they're pointers to methods but I don't fully understand them, how they wodebug profile does not existhey can you guys help me when i run my visual studio solution it says "debug profile does not exist"Share static variables between projects to build WebAPISo, I already searched on google but couldn't find anything. I have two projects, one is a discord bExtracting string from string?I have a string that looks kinda like this: ```cs string superCoolString = ""something.something.thiHow do I make MSVS change every instance name of a variable?As per title. Say I edit the declaration for xInput to Input. According to some tutorials, pressing Why is the generic delegate does not accept my method?I've created a generate delegate as a test and wanted it to assign it to a variable, but it seems it