。NET Core发布编译错误

问题描述 投票:0回答:1

我有一个.NET Core 2.2项目,可以在Debug和Release配置中很好地构建。但是,当我尝试发布项目时,构建失败。

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 build publish core
1个回答
1
投票

您可以从终端尝试吗?

dotnet发布

© www.soinside.com 2019 - 2024. All rights reserved.