anjoy8 / Blog.Core

💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
http://apk.neters.club/.doc
Apache License 2.0
5.06k stars 1.38k forks source link

编译报错NETSDK1152 #220

Closed wenchui closed 2 years ago

wenchui commented 2 years ago

error NETSDK1152: Found multiple publish output files with the same relative path: //Blog.Core.Api/appsettings.json, //Blog.Core.Tests/appsettings.json. [***//Blog.Core.Tests/Blog.Core.Tests.csproj]

wenchui commented 2 years ago

在.6.0.100环境执行编译

anjoy8 commented 2 years ago

目前没有发现这个问题,你可以删除Blog.Core.Tests/appsettings.json,再试试

wenchui commented 2 years ago

删除后报这个错,.6.0.100环境执行编译,master分支 error MSB3030: Could not copy the file "//Blog.Core.Tests/appsettings.json" because it was not found. [//Blog.Core.Tests/Blog.Core.Tests.csproj]

anjoy8 commented 2 years ago

其实不用删, 测试没问题,具体问题你自己排查吧,不是很清楚

wenchui commented 2 years ago

参考如下帖子 https://www.poppastring.com/blog/fixing-error-netsdk1152-after-upgrading-to-net-6 在Blog.Core.Tests/Blog.Core.Tests.csproj中添加false后代码后编译正常,如下

net6.0 false false
anjoy8 commented 2 years ago

Good, 你可以提交下PR,可能和具体的编译模式不同,我还没遇到过