question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GenFacades fails to generate not supported assembly for reference source that contains throw null expression body

See original GitHub issue
  • This issue is blocking
  • This issue is causing unreasonable pain

GenFacades not supported assembly fails for reference source files that use the => throw null; syntax instead of a full method body.

C:\git\runtime5\artifacts\obj\System.Net.Quic\net6.0-Browser-Debug\System.Net.Quic.notsupported.cs(17,9): error CS8057: Block bodies and expression bodies cannot both be provided. [C:\git\runtime5\src\libraries\System.Net.Quic\src\System.Net.Quic.csproj]

        public QuicListener(IPEndPoint listenEndPoint, System.Net.Security.SslServerAuthenticationOptions sslServerAuthenticationOptions) { throw new System.PlatformNotSupportedException(System.SR.SystemNetQuic_PlatformNotSupported);  }
=> throw null;

cc @Anipik @ericstj

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
ericstjcommented, Nov 4, 2020

@safern is currently investigating. We have discussed with folks from Roslyn in the past and no tool existed but the closest one was the functionality that backed go-to definition. We indeed want Roslyn APIs to back as much of the GenAPI stack as possible so we get new language features automatically. We also desire to publicly ship the tool and there is likely a better place for it to live than arcade or runtime.

1reaction
Anipikcommented, Nov 3, 2020

We can use https://apisof.net/catalog/Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax.ExpressionBody to differentiate between the 2 cases and fix the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source generator fails to load referenced assembly #49075
I'm trying to use Scriban to generate code more easily from a source generator. However, it fails to load the assembly: CSC :...
Read more >
How to fix "Referenced assembly does not have a strong ...
The above steps work fine unless your third-party assembly (A.dll) references another library (B.dll) which also has to be signed.
Read more >
Solved: Expression.Error: We cannot convert the value null...
I'm working in an ERP reporting project and I have relatively complex PBI and PQ set with dozens of tables and processing steps....
Read more >
Working with nullable reference types - EF Core
This page introduces EF Core's support for nullable reference types, and describes best practices for working with them.
Read more >
Null Reference Exceptions
NullReferenceException happens when your script code tries to use a variable which isn't set (referencing) and object. The error message that appears tells...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found