【发布时间】:2020-05-04 11:18:57
【问题描述】:
我有一个 .NET Core 2.2 项目,它在调试和发布配置中都构建得很好。但是,当我尝试发布项目时构建失败。
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?)
Controllers\ConsentController.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?)
Controllers\ConsentController.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?)
我已尝试清洁溶液。其他人看到过类似的行为吗?
【问题讨论】:
-
我们需要查看有关您的项目配置的更多详细信息才能回答这个问题。
标签: c# .net-core build publish