首页 > 解决方案 > 为什么在 .NET Core 主机中打开文件?

问题描述

我刚刚从 .NET Core 2.2 升级到 .Net Core 3.0。

我有一个参考我的主项目的 XUnitTest 项目。

重建时出现以下错误:

Could not copy "obj\Debug\netcoreapp3.0\XXX.dll" to "bin\Debug\netcoreapp3.0\XXX.dll". 
Exceeded retry count of 10. Failed. The file is locked by: ".NET Core Host (2016)"  


Unable to copy file "obj\Debug\netcoreapp3.0\XXX.dll" to "bin\Debug\netcoreapp3.0\XXX.dll". 
The process cannot access the file 'bin\Debug\netcoreapp3.0\Customer.Service.Tests.dll' because it is being used by another process.    

我还尝试手动删除 bin 文件夹,重新启动 VS 2019。唯一“有效”的是删除参考并重新启动计算机(win10)

为什么文件在 .NET Core Host(2016) 中打开?

标签: asp.net-core

解决方案


问题是 Swagger (Swashbuckle.AspNetCore) Swashbuckle.AspNetCore 4.0.1 不支持 .NET Core 3.0 版本 5.0.0-rc3 支持。


推荐阅读