简体   繁体   English

引用的DLL驻留在项目的\\ bin \\ Debug文件夹中是否可以接受?

[英]Is it Acceptable for Referenced DLLs to reside in the project's \bin\Debug folder?

Amos Moses was a wimp! 阿摩斯(Amos Moses)真是个w夫! "Rassling" alligators is nothing compared to this CE / CF Gordian Knotesque mass of spaghetti I'm dealing with. 与我正在处理的CE / CF Gordian Knotesque义大利面相比,“咆哮”扬子鳄简直是小菜一碟。

In my latest gyrations to try to somehow coax this big ball of mud to at least compile and run, I notice that some of the referenced DLLs live in the project's own \\bin\\Debug folder. 在我最近的回旋中,尝试以某种方式哄骗这个大泥泞的球至少可以编译和运行,我注意到一些引用的DLL位于项目自己的\\ bin \\ Debug文件夹中。

Is that safe, and sound? 安全可靠吗? It seems rather tail-chasey or circular-referencey to me. 对我来说,这似乎有些追尾或循环引用。 It appears to work, but...would I be better off moving those DLLs elsewhere? 它似乎可以工作,但是...我最好将这些DLL移到其他地方吗?

UPDATE UPDATE

To be clear, here is what is in \\bin\\Debug: 要清楚,这是\\ bin \\ Debug中的内容:

在此处输入图片说明

...in \\bin\\Release: ...在\\ bin \\发行版中:

在此处输入图片说明

...and how the OpenNETCF* DLLs are referenced: ...以及如何引用OpenNETCF * DLL:

在此处输入图片说明

It appears to work, but...would I be better off moving those DLLs elsewhere? 它似乎可以工作,但是...我最好将这些DLL移到其他地方吗?

In general, I would not recommend having that be the referenced location. 通常,我不建议将其作为参考位置。 It is common to have the referenced assemblies copied to that folder, but they should live elsewhere (and have their HintPath in the C# project file referencing the other location). 将引用的程序集复制该文件夹是很常见的,但是它们应该HintPath在其他位置(并在C#项目文件HintPathHintPath引用其他位置)。

A Clean of your project will not delete them and as long as they're in source control, you can't lose them. 清除项目不会删除它们,只要它们处于源代码控制中,就不会丢失它们。

This used to be practice when finding and installing the proper versions of third-party libraries and SDKs was a hassle. 这在寻找和安装适当版本的第三方库和SDK时很麻烦。 When the referenced libraries are included in the bin folder, they only have to be checked out from source control to work, instead of having to install the binaries from wherever on each new workstation and user, in the same location, in order to reference them properly and copy them on build. 当引用的库包含在bin文件夹中时,只需将它们从源代码管理中检出即可工作,而不必在同一位置的每个新工作站和用户上从任何位置安装二进制文件以引用它们正确地复制它们并构建。

Problems that can be solved using virtual machines or disk imaging for development machines, or properly archiving installers of said libraries. 使用虚拟机或开发机器的磁盘映像,或适当归档所述库的安装程序,可以解决的问题。

This still doesn't mean the bin folder is a proper location. 这仍然并不意味着bin文件夹是正确的位置。 I'd opt for a Libraries or Third-Party folder, outside your project directory, preferably version controlled. 我会在您的项目目录之外选择一个Libraries或Third-Party文件夹,最好是版本控制的。

Now with the official NuGet package store and private ones you can use to share internal libraries, this shouldn't be a problem at all anymore for new development. 现在有了正式的NuGet软件包商店和可以用于共享内部库的私有软件包,对于新开发而言,这根本不再是问题。

暂无
暂无

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

相关问题 MSBuild不会直接将引用的dll复制到bin文件夹 - MSBuild does not copy directly referenced dlls to bin folder 子项目引用的某些DLL未复制到Solution的输出文件夹 - Some DLLs referenced by sub-project not being copied to Solution's output folder 如何避免将引用的项目配置复制到 bin 文件夹 - How to avoid copying referenced project config to bin folder 未将引用的ClassLibrary的从属DLL添加到应用程序的BIN中 - Dependent DLLs of referenced ClassLibrary not added to BIN of application Visual Studio / MSBuild将引用类库的app.config复制为* .dll.config到当前项目的bin文件夹 - Visual Studio/MSBuild copy referenced class library's app.config as *.dll.config to bin folder of current project 如何将第三方dll从bin文件夹移动到ASP.NET Web Forms项目中的另一个文件夹? - How to move third party dlls from bin folder to another folder in ASP.NET Web Forms project? .NET 中另一个项目使用的项目中引用的 DLL - DLLs referenced in a project used by another project in .NET 为什么即使编译时没有引用任何库,也会将dll文件复制到项目的Bin / Debug文件夹中? - why are there dll files copied to my project's Bin/Debug folder upon compilation despite not referencing any of those libraries? MSBuild 将 dll 复制到 bin 文件夹,而不是遵循路径 - MSBuild copy dlls to bin folder, not following the path 通过复制Bin> Debug文件夹内容安装应用程序有什么问题? - What's wrong with installation of an application by copying Bin>Debug folder content?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM