martinothamar / Mediator

A high performance implementation of Mediator pattern in .NET using source generators.
MIT License
2.16k stars 71 forks source link

Generator 'IncrementalMediatorGenerator' failed to initialize under .net 8 (8.0.0.100) and Sonoma 14.1 #126

Closed nikjuice closed 1 year ago

nikjuice commented 1 year ago

Just upgraded the project to the .net8 (8.0.0.100) from the .net6 and start getting this error during build:

Error CS1061 : 'IServiceCollection' does not contain a definition for 'AddMediator' and no accessible extension method 'AddMediator' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)

and this is I believe a result of:

12>CSC: Warning CS8784 : Generator 'IncrementalMediatorGenerator' failed to initialize. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentNullException' with message 'Value cannot be null. (Parameter 'path1')'.

Any suggestion where to take a look are much appreciated. Thanks!

Update: the issue is not replicatable under Windows, but it is reproducible under docker compose using .net 8 base image (FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build)

nikjuice commented 1 year ago

Seems upgrading from 2.1.5 to 2.1.7 fixed the problem