Skip to content

EnC fails when replacing generated regex attribute string #72331

@jjonescz

Description

@jjonescz

Version Used: SDK 8.0.201, VS Version 17.10.0 Preview 2.0 [34626.289.main]

Steps to Reproduce:

using System.Text.RegularExpressions;

public static partial class Program
{
    public static void Main()
    {
        Console.ReadLine();
    }

    [GeneratedRegex(@".*", RegexOptions.Compiled)]
    public static partial Regex TestRegex();
}

Start debugging, change the @".*" string to something else and click Hot reload.

Expected Behavior: Works or at least doesn't show "unexpected error".

Actual Behavior:

[Error] C:\Users\janjones\Code\issues\roslyn\EnC-ReplaceRegex\ClassLibrary1\ClassLibrary1.sln (line 1): error ENC1002: Cannot apply changes -- unexpected error: 'Unexpected value 'System.Text.RegularExpressions.Generated.Utilities' of type 'Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamedTypeSymbol''

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions