I have a .NET Core 2.2 project that builds in both Debug and Release configuration just fine. However, the build fails when I try and publish the project.
Startup.cs(26,16): Error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)
Startup.cs(35,39): Error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?)
Startup.cs(29,24): Error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?)
ControllersConsentController.cs(37,13): Error CS0246: The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
ControllersConsentController.cs(30,26): Error CS0246: The type or namespace name 'ILogger<>' could not be found (are you missing a using directive or an assembly reference?)
I've tried cleaning the solution. Anyone else seen similar behaviour?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…