문제:
조건:
Target framework: net5.0-windows
Deployment mode: Self-contained
Taget runtime: win-x64
File publish options: Produce single file, Enable ReadyToRun compilation
위 조건에서 Publish 시 오류 발생
하지만 몇 가지 실험을 해 본 결과 위 조건들 중 Produce single file만 활성화되어있어도 발생하는 것 같음
4>The "GenerateBundle" task failed unexpectedly.
4>System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath
4> at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
4> at Microsoft.NET.Build.Tasks.GenerateBundle.ExecuteCore()
4> at Microsoft.NET.Build.Tasks.TaskBase.Execute()
4> at Microsoft.NET.Build.Tasks.TaskWithAssemblyResolveHooks.Execute()
4> at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
4> at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
위와 같은 오류와 함께 Publish가 중단됨
원인:
본 프로젝트와 ProjectReference로 지정된 프로젝트 간에 중복되는 파일이 있고 각 파일들의 Build Action 또한 같음
해결:
1. 두 프로젝트 간에 중복되는 파일을 제거
2. 반드시 두 프로젝트에 각각 필요하다면 Build Action을 다르게 지정
'Code > C#' 카테고리의 다른 글
C# switch Conflicting variable is defined below (0) | 2021.09.08 |
---|---|
C# foreach Collection was modified 오류 (0) | 2021.08.26 |
C# Dispatcher.BeginInvoke에 lambda식 사용 (0) | 2021.08.12 |
C# No process is associated with this object (0) | 2021.08.07 |
단일 파일로 빌드한 결과물이 에러와 함께 즉시 종료 (0) | 2021.07.25 |
C# .NET 5.0 단일 파일로 빌드 (0) | 2021.07.24 |
C# LINQ를 쓸 수 없는 자료형에 LINQ 사용 (0) | 2021.07.19 |
C# SQLite DateTime 읽기 (0) | 2021.06.27 |