I am porting company products in .Net core 6 from .Net 4.8. In the solution, there is an output directory containing: Assemblies, Configuration, Log, Resources directories and only .exe, .pdb and .exe.config of the launcher project. Dlls are in Assemblies directory and I absolutely need to replicate the same structure.
In launcher project .csproj file we have set:
<OutputPath>$(SolutionDir)\$(Configuration)</OutputPath>
In others:
<OutputPath>$(SolutionDir)\$(Configuration)\Assemblies</OutputPath>
During compilation, VS Studio Professional 2022 continues to copy .dlls/.pdbs of the ProjectReference included projects and recursively it copies all the .dlls more and less. In order to avoid this behavior, I have tried a lot of methods, such as using all these properties (also in different setting combinations: none, all, compile...) but the issue still happens:
<CopyLocalLockFileAssemblies>
<CopyLocal>
<CopyLocalSatelliteAssemblies>
<IncludeAssets>
<ExcludeAssets>
<PrivateAssets>
<AppendTargetFrameworkToOutputPath>
At the moment, I am building in windows but in the future there will also be some linux machines that have to build solutions, so I need a method that should work in all environments.
Is it possible to do it?
Loading of assemblies is not a problem, I have modified AssemblyLoadContext.Default.Resolving and if I manually delete dlls from the output directory, the application works but I need something more "elegant" than a delete script after building (Post-build event).