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.

GenAPI generates invalid '$' token in method name

See original GitHub issue

Running GenAPI on Microsoft.Build,16.10.0 (via SBRP) generates the following method

namespace Microsoft.Build.Graph
{
    public partial class GraphBuildOptions : System.IEquatable<GraphBuildOptions>
    {
...
        public virtual GraphBuildOptions <Clone>$() { throw null; }
...

This causes compiler errors:

/repos/source-build-reference-packages/artifacts/source-build/self/src/src/referencePackages/src/microsoft.build/16.10.0/lib/net5.0/Microsoft.Build.cs(2558,49): error CS1519: Invalid token ‘$’ in class, record, struct, or interface member declaration [/repos/source-build-reference-packages/artifacts/source-build/self/src/src/referencePackages/src/microsoft.build/16.10.0/Microsoft.Build.16.10.0.csproj::TargetFramework=net5.0] [/root/.nuget/packages/microsoft.dotnet.arcade.sdk/8.0.0-beta.23168.1/tools/Build.proj] /repos/source-build-reference-packages/artifacts/source-build/self/src/src/referencePackages/src/microsoft.build/16.10.0/lib/net5.0/Microsoft.Build.cs(2558,49): error CS1056: Unexpected character ‘$’ [/repos/source-build-reference-packages/artifacts/source-build/self/src/src/referencePackages/src/microsoft.build/16.10.0/Microsoft.Build.16.10.0.csproj::TargetFramework=net5.0] [/root/.nuget/packages/microsoft.dotnet.arcade.sdk/8.0.0-beta.23168.1/tools/Build.proj]

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jaredparcommented, Apr 13, 2023

@jaredpar do you know when that specific commit will reach dotnet/sdk

I assume it’s a part of this #31633

I guess it’s intentional that roslyn’s main branch doesn’t flow into dotnet/sdk?

Yes / No. Historically code flow from roslyn / razor to sdk has been frought with problems that stem from rationalizing the .NET SDK vs. VS schedule. It’s lead to lots of missed fixes, scrambles, etc … For last two months we’ve been working with the sdk team to find a sane / predictable way to manage the code flow.

For 17.6 we tried a setup where we concentrated flow from our release branches instead of main. That worked fine but resulted in periods of delay. Essentially we were pushing to sdk once per VS preview. For 17.7 we’re trying a different approach where we keep the flow where our active branch is.

So yes this was intentional at the time but going forward wont’ be.

1reaction
MichaelSimonscommented, Apr 7, 2023

This reproduces in dotnet/source-build-reference-packages which is using the following version of GenAPI

<Dependency Name="Microsoft.DotNet.GenAPI.Task" Version="8.0.100-preview.4.23203.10">
  <Uri>https://github.com/dotnet/sdk</Uri>
  <Sha>326fa05c36c21a75fec88a28faa555371c9af8c2</Sha>
</Dependency>

This version of the SDK contains Rosyln 542fea0c2a93aacb3e8c52c2ce43e975d29832f3. I am not seeing the fix when looking at the Roslyn source. It looks like the PR was merged into main while the SDK is retrieving updates from release/dev17.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tomcat: java.lang.IllegalArgumentException: Invalid ...
This exception can occur when you try to execute HTTPS request from client on endpoint which isn't HTTPS enabled.
Read more >
GenFacades fails for methods which contain method local ...
GenFacades fails for methods which contain method local constants. ... to invalid local constant signatures (NIL tokens) being generated.
Read more >
Invalid character found in method name. HTTP ...
Getting following error while running in local java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens ...
Read more >
Doc Gen API generating new PDF that will only open...
After the newly generated PDF is created from my DOCX template and JSON data, the file will throw and error if trying to...
Read more >
CloudBolt API v3
Find CloudBolt's next-gen API (v3) from the API Browser in CloudBolt, or access it through an API Editor like Swagger UI.
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