Visual Studio 22 EXE缺少DLL
我回顾了这个平台上关于我正在经历的新问题的多个回复,并想知道是否有更好的方法。
我在最新版本的Visual Studio 2022中使用了Dotnet Framework 4.8创建了一个控制台应用程序。我进行了干净且重建控制台应用程序来创建其EXE文件。然后,我将生成的EXE从发行箱文件夹移动到服务器上的另一个文件夹以进行生产。但是,当我打电话给EXE并执行EXE时,我会遇到一个错误,认为支持DLL丢失了。我正在使用sendgrid从EXE内发送电子邮件,并确实安装了Nuget软件包以支持SendGrid功能。
为了使EXE工作,我还必须从发布文件夹中拖动所有生成的DLL。以前从来都不是这种情况。
我如何编译EXE,以便它可以像一个文件一样工作?
I reviewed multiple responses from this platform about this new issue that I am experiencing and was wondering if there was a better way.
I created a Console application, utilizing DOTNET Framework 4.8 in the latest version of Visual Studio 2022. I conducted a Clean and rebuild of the Console App to create its EXE file. Then, I moved the generated EXE from the Release BIN folder to another folder on my Server for production. However, when I called and executed the EXE, I get an error that supporting DLLs were missing. I am using SendGrid to send emails from within the EXE and did install the Nuget Package to support the SendGrid functionalities.
In order for the EXE to work, I had to also drag all the generated DLLs from the release folder. This was never the case before.
How do I compile the EXE so it works as is into one single file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢您的所有答案和支持。阅读所有内容后,发布推荐是赢家。我只能获取一个然后将其传输到服务器的EXE文件,并且它可以单独运行。我不是被要求提供SendGrid DLL或任何其他请求。
下图描述了我的Net6.0的发布设置。作为此过程的支持文档,我还找到了以下文章: https://learn.microsoft.com/en-us/dotnet/core/core/deploying/single-file/overview
Thank you for all of your answers and support. After reading all of them, the Publish recommendation is the winner. I was able to get just one exe file that I then transferred to my Server and it runs without issues on its own. I am not being asked to provide the SendGrid DLL or any other requests.
The pic below depicts my Publish Settings for net6.0. As a supporting document for this process, I also found the following article: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview