简体   繁体   English

.NET 核心发布编译错误

[英].NET Core Publish Compilation Errors

I have a .NET Core 2.2 project that builds in both Debug and Release configuration just fine.我有一个 .NET Core 2.2 项目,它在调试和发布配置中都构建得很好。 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?) 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?)

I've tried cleaning the solution.我试过清洗溶液。 Anyone else seen similar behaviour?其他人看到过类似的行为吗?

Can you try it from terminal?你可以从终端试试吗?

dotnet publish点网发布

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM