简体   繁体   English

如何避免在Web发布中发布库文件夹?

[英]How can I avoid publishing the library folder in a Web Publish?

I have moved binary files into the project under the bin folder to avoid publishing the same binary files twice since one of the binaries is huge; 我已经将二进制文件移到bin文件夹下的项目中,以避免重复发布相同的二进制文件两次,因为其中一个二进制文件很大。 ie 15MB. 即15MB。

This was originally in a separate Includes folder. 该文件最初位于单独的“ 包含”文件夹中。 So the files were being copied twice to the publish folder. 因此,文件被复制了两次到publish文件夹。

Is the bin folder the correct placement for these or are there other steps I should take? bin文件夹是这些的正确放置位置还是我应该采取其他步骤?

Edit: Sorry if I gave a poor explanation (and original title). 编辑:对不起,如果我给出的解释不好(和原始标题)。 I've changed the title; 我已更改标题; this was "Where should static libraries (3rd party DLLs) be kept in Visual Studio?", and is now, "How can I avoid publishing the library folder in a Web Publish?" 这是“静态库(第三方DLL)应该在Visual Studio中保存在哪里?”,现在是“如何避免在Web Publish中发布库文件夹?”。

As mentioned, I originally had a separate folder named Includes . 如前所述,我最初有一个名为Includes的单独文件夹。 When I did a Web Publish, each of the DLLs are published twice; 当我进行Web发布时,每个DLL被发布两次。 one into the bin folder, the other into the Includes folder. 一个进入bin文件夹,另一个进入Includes文件夹。 In this case, I am publishing at least an extra 15MB of unnecessary file space. 在这种情况下,我将发布至少15MB的不必要文件空间。 Normally, not a big deal but if I am on a very slow connection, I'll need to wait longer to deploy the project to its environment. 通常,这没什么大不了,但是如果我的连接速度很慢,则需要等待更长的时间才能将项目部署到其环境中。

I moved the DLLs back into a separate folder but the folder is still published along with the bin output folder. 我将DLL移回了一个单独的文件夹,但该文件夹仍与bin输出文件夹一起发布。 I did this to see if the placement of these files would set their properties differently. 我这样做是为了查看这些文件的放置位置是否会不同地设置其属性。

I have tried various settings for Build Action and other property settings for these libraries without success. 我尝试了“构建操作”的各种设置以及这些库的其他属性设置,但均未成功。

Is there no way around publishing the DLLs twice? 是否没有办法两次发布DLL?

If these files are part of the overall source of the system (not necessarily as source code, but as source-control-tracked artifacts nonetheless), then you probably don't want to keep them in the output folder for the build. 如果这些文件系统(不一定是源代码,但尽管如此源控制跟踪工件)的总源的一部分,那么你可能不想让他们在为构建输出文件夹。 The output folder should be transient and shouldn't be tracked in source control. 输出文件夹应该是临时的,不应在源代码管理中进行跟踪。

Keep 3rd party libraries in a library folder. 将第三方库保存在库文件夹中。 The folder structure in source control might look something like this: 源代码管理中的文件夹结构可能如下所示:

/
--/lib
--/Project1
----/SomeSubFolder
--/Project2
----/Images
----/Styles

and so on. 等等。

Each Project would have its own bin folder when it gets compiled, which itself may contain other folders for types of compilation (Release, Debug, etc.). 每个Project在编译时都会有自己的bin文件夹,该文件夹本身可能包含其他用于编译类型(Release,Debug等)的文件夹。 But you don't want those build artifacts tracked in source control or in any way interfering with what's in source control. 但是,您不希望这些构建工件在源代码控制中被跟踪,或者以任何方式干扰源代码控制中的内容。

The projects would reference their library dependencies, and at build time those dependencies would be copied to the output folder to be used by the application runtime. 这些项目将引用其库依赖关系,并且在构建时,这些依赖关系将被复制到输出文件夹,以供应用程序运行时使用。

暂无
暂无

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

相关问题 如何停止Visual Studio的“发布网站”发布我的_ReSharper文件夹? - How do I stop Visual Studio's 'Publish Web Site' from publishing my _ReSharper folder? 如何从Visual Studio发布中排除bin文件夹? - How can I exclude the bin folder from Visual Studio publish? 在发布时,某些文件夹不在发布文件夹中 - On publishing some folders are not coming in publish folder 如何自动将Visual Studio 2017 Web项目发布到文件夹 - How to automate Visual Studio 2017 web project publish to folder 如何在不删除目标文件夹内容的情况下使用Visual Studio 2008中的“发布”功能? - How can I use the “Publish” function in Visual Studio 2008 without erasing the contents of the target folder? Visual Studio 发布配置文件:发布前删除服务器上的特定文件夹 - Visual Studio Publish Profile: Delete specific folder on the server before publishing 使用 dotnet publish 发布整个解决方案时,为每个项目定义发布文件夹 - Define publish folder per project when publishing whole solution with dotnet publish 我如何在本地开发Visual Studio网站然后发布 - How do I develop a visual studio web locally then publish it 如何使用 Web 发布 .NET 应用程序部署到服务器上的特定文件夹(子目录)? - How do you publish an .NET app using Web Deploy to a specific folder on the server (subdirectory)? 避免在从VS发布到Cloudformation的主web.config中进行更改 - Avoid changes in main web.config on Publish to Cloudformation from VS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM