davidwengier / SourceGeneratorTemplate

A basic template for writing a C# source generator
181 stars 29 forks source link

IncrementalGenerator is not working correctly. #8

Closed AvtsVivek closed 2 years ago

AvtsVivek commented 2 years ago

Hi Thanks for this simple tutorial.

The moment I add a new type to Program.cs, the IncrementalGenerator stopped working. The other generator is working fine.

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Types in this assembly:");
        foreach (Type t in typeof(Program).Assembly.GetTypes())
        {
            Console.WriteLine(t.FullName);
        }
    }
}

public class HereWeGo {  }

image

image

If I then comment out that HereWeGo class, restart visual studio, then things restore back.

davidwengier commented 2 years ago

Thanks. I should test my work next time :)