如何配置 Visual Studio 来生成扩展名为 .dll 的 ac# 可执行文件
我的解决方案中有两个项目,第二个项目生成一个“Windows 应用程序”类型的可执行文件,并定义了启动对象。我不希望该项目生成的 exe 文件与我的应用程序“whatever.exe”位于同一目录中,我想将其重命名为“whatever.dll”,因为用户不打算手动运行此应用程序(在第一个进程中,我以该文件为目标调用 Process.Start() - 只要 PE 标头将其标识为可执行文件,Windows 就可以执行它)。
我可以简单地手动将第二个项目的输出重命名为 .dll,甚至可以在构建后步骤中将其自动化,但是有没有办法创建“类库”类型的项目并为其定义启动对象?
I have two projects in my solution, the second produces an executable of type 'Windows Application' with a Startup Object defined. I don't want the exe file this project produces to sit in the same directory as my application called 'whatever.exe', I want to rename it to 'whatever.dll', since the user is not intended to run this application manually (in the first process I call Process.Start() with this file as the target - as long as the PE header identifies it as an executable file windows can execute it just fine).
I can simply manually rename the output of the second project to .dll, even automate it in a post build step, but is there a way instead to create a project of type 'Class Library' and define a Startup Object for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Visual Studio 无法专门配置为给 exe 项目提供除“exe”之外的扩展名(您已经提到了构建后步骤,但这不是直接的)。
Visual Studio cannot be specifically configured to give exe projects an extension other than "exe" (you have already mentioned a post-build step, but this is not direct).