I have a project referencing several other self-built projects. I want to move all my DLLs to a specific subfolder "DLLs". I found this article and did it the same way:
Build DLL to a separate folder
So I defined a new section in my App.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="DLLs" />
</assemblyBinding>
</runtime>
And I moved all DLLs to a specific output folder using a post-build event:
mkdir "$(TargetDir)DLLs"
move /Y "$(TargetDir)\*.dll" "$(TargetDir)DLLs\"
move /Y "$(TargetDir)\*.pdb" "$(TargetDir)DLLs\"
I checked the DLLs are actually moved to the specified "DLLs" folder in the output directory. But the program will not start. The following error was shown in the Debug output:
"The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core. The program '[12396] MyProg.exe' has exited with code 2147516570 (0x8000809a)."
Please note that I am working with .NET 6, so .NET Core is not applicable for me.
What could be the cause for this problem?