简体   繁体   English

删除引用时 Visual Studio 项目无法编译,但生成的 EXE 文件在没有相同 DLL 的情况下运行

[英]Visual Studio project doesn't compile when deleting a reference but the built EXE file runs without that same DLL

  1. I have created .NET 4.7.2 project and now refactoring and removing unused libraries.我创建了 .NET 4.7.2 项目,现在重构和删除未使用的库。

  2. By exe I mean successfully compiled exe file. exe是指成功编译的exe文件。

Try To Delete Bin Folder From your Project Path尝试从项目路径中删除 Bin 文件夹

There is a couple possibilities:有几种可能性:

First: Compiled Exe didn't use the.dll at all as you said, so no piece of code will produce an exception because there's no call to that library inside it.首先:编译的Exe根本没有使用.dll,所以没有一段代码会产生异常,因为里面没有调用那个库。

Second: Actually, the dll is somewhere in your computer (on an obscure folder, but registered) and the exe is accessing it witouth any problem第二:实际上,dll 位于您计算机中的某个位置(在一个不起眼的文件夹中,但已注册)并且 exe 正在访问它而没有任何问题

I would bet on first possibility我会打赌第一种可能性

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在没有 Visual Studio IDE 的情况下将带有多个 DLL 文件的项目编译为单个 EXE - Compile project with multiple DLL file to single EXE without Visual Studio IDE 在Visual Studio项目中添加Microsoft.Office参考时,使用exe部署哪个dll? - What dll to deploy with exe when Microsoft.Office reference is added in Visual Studio project? 如何在没有默认 DLL 文件的情况下编译 C# Visual Studio 项目? - How can I compile a C# visual studio project without the default DLL file? 无法将dll程序集引用到Visual Studio Code项目 - Can't reference dll assembly to the Visual Studio Code project 使用process.start()运行cmd.exe时如何引用存储在visual studio项目资源中的exe文件 - How to reference an exe file stored in visual studio project resource when running cmd.exe using process.start() Visual Studio 2017 Asp.Net Core 项目不会在构建时复制依赖的 dll 文件 - Visual Studio 2017 Asp.Net Core project doesn't copy dependent dll file on build Visual Studio for Mac 编译错误:您的项目文件未将“win”列为“RuntimeIdentifier” - The Visual Studio for Mac compile error: Your project file doesn't list 'win' as a "RuntimeIdentifier" Visual Studio解决方案无法编译,但项目确实如此 - Visual Studio solution doesn't compile, but project does 如何在没有 Visual Studio 的 CLI 项目中添加.dll 文件? - How to add .dll file in CLI project without visual studio? 如何在 Visual Studio 中添加对项目的 a.dll 引用 - How to add a .dll reference to a project in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM