We are using dotnet 6.The goal is to split implementation to following structure:
- Executable.Web1
- ProjectReference Lib.Domain
- Executable.Web2
- ProjectReference Lib.Domain
- Lib.Domain
- IMyService
- Lib.Component.A
- MyServiceA
- ProjectReference Lib.Component.Dependency
- Lib.Component.B
- MyServiceB
- ProjectReference Lib.Component.Dependency
Executables loads correct component according to the configuration. I'm using Assembly.LoadFrom(assemblyPath); for that. It works, but I have troubles with build. I don't want to reference both Lib.Component.A and Lib.Component.B from executable project. I want to have a build dependency but not a reference. There is a ReferenceOutputAssembly=false options in csproj. That does exactly what I need. The projects Lib.Component.A and Lib.Component.B will build if you build the executable project. But it is not referenced. The problem is that it is not in the output bin folder. How to ensure that the build result is
Executable.Web1/bin
- Executable.Web1
- Lib.Domain
- Lib.Component.A
- Lib.Component.B
- Lib.Component.Dependency
Executable.Web2/bin
- Executable.Web2
- Lib.Domain
- Lib.Component.A
- Lib.Component.B
- Lib.Component.Dependency