how to produce a mix of dll and exe in one C# project in visual studio or other build tools?

前端 未结 2 1117
慢半拍i
慢半拍i 2021-01-24 19:41

how to produce a mix of dll and exe in one C# project in visual studio or other build tools ? Is it technically possible ? Yes I know it can done in 2 or more projects .

2条回答
  •  余生分开走
    2021-01-24 20:17

    I'm not sure what the motivations for your question are, as you can reference a .Net executable as if it were a dll anyway, but you could consider copying the exe file to a dll file with the same name (yes it's a hack but not sure of your motivations).

    You can automate this process using a Visual Studio post-build event for your project. This will handle creating the dll copy each time you have a successful build:

    copy "$(TargetPath)" "$(TargetDir)$(TargetName).dll"
    

提交回复
热议问题