For a while now I have had visual studio producing builds that have all sorts of extra files in them. I have checked everything that I know of for where these could be coming from and I am out of ideas.
有一段时间我现在有视觉工作室制作版本,其中包含各种额外的文件。我已经检查了我所知道的所有这些可能来自哪里,而且我没有想法。
For example I was previously using MbUnit but now I use nunit. None of my projects even reference MbUnit but it is still appearing in my bin\Debug and bin\Release folders when I build. In addition my bootstrapper project doesn't even reference any libraries that use a test framework so why is it appearing in BootStrapper\bin\Relase ?
例如,我之前使用的是MbUnit,但现在我使用了nunit。我的项目都没有引用MbUnit,但是当我构建时它仍然出现在我的bin \ Debug和bin \ Release文件夹中。另外我的bootstrapper项目甚至没有引用任何使用测试框架的库,那么为什么它出现在BootStrapper \ bin \ Relase中呢?
Also pdb files for some (but not all) of my projects and vshost files keep being transferred to the bin directoreies even when I build with the Release target. I haven't messed around wiht the definition of the configuration target at all!
一些(但不是全部)我的项目和vshost文件的pdb文件仍然被转移到bin directoreies,即使我使用Release目标构建。我根本没有弄清楚配置目标的定义!
Does anyone have any idea where these could be coming from? I must be missing some bit of knowledge.
有谁知道这些可能来自哪里?我必须缺少一些知识。
3 个解决方案
#1
By default release builds do create the pdb files, so it isn't unusual to see them in there. I'd assume the same is true of the vshost file. If you want to build without them bring up the projects settings (from the project's context menu in the solution explorer) go to the "build" tab, at the top ensure that you are looking at the release configuration and then click the "advanced" button at the bottom. In the new window that pops up there is a dropdown labelled "Debug Info", set this to none to disable the pdb creation.
默认情况下,发布版本会创建pdb文件,因此在那里看到它们并不罕见。我假设vshost文件也是如此。如果你想在没有它们的情况下构建项目设置(从解决方案资源管理器中的项目上下文菜单),请转到“构建”选项卡,在顶部确保您正在查看发布配置,然后单击“高级”底部的按钮。在弹出的新窗口中,有一个标记为“Debug Info”的下拉列表,将其设置为none以禁用pdb创建。
As for the references, that doesn't sound like correct behaviour, but bare in mind the they are recursive so if a projectA references projectB and projectB references mbunit then the mbunit dlls will be copied into any build folder for projectA. So it may be that you have missed one reference somewhere and this is propagating throughout your entire solution...?
至于引用,这听起来不是正确的行为,但是记住它们是递归的,所以如果projectA引用projectB和projectB引用mbunit,那么mbunit dll将被复制到projectA的任何构建文件夹中。所以可能是你错过了某个地方的某个参考,这是在整个解决方案中传播......?
Also ensure that you are rebuilding the solution rather than building - a build will not get rid of any files that already exist in the folder. Even better manually delete the bin and obj folder before you build to ensure you have a clean slate.
还要确保您正在重建解决方案而不是构建 - 构建不会删除文件夹中已存在的任何文件。甚至最好在构建之前手动删除bin和obj文件夹,以确保您有一个干净的平板。
Just done a quick test in Visual Studio and it looks like a vshost file is created for whichever project is set as your StartUp project in both debug and release nomatter what the debug info setting is. To stop this you need to uncheck the "Enable the Visual Studio hosting process" under the Debug tab of the project's settings.
刚刚在Visual Studio中进行了一次快速测试,它看起来像是在调试和发布中设置为StartUp项目的任何项目都创建了一个vshost文件,调试信息设置是什么。要停止此操作,您需要取消选中项目设置的“调试”选项卡下的“启用Visual Studio主机进程”。
#2
You can safely remove the .pdb files and the .vshost files, the former is for debugging information (yes, even release builds can be debugged to some degree) and the later is for visual studio only, it makes running with vs as an attached debugger faster (again, release or not).
您可以安全地删除.pdb文件和.vshost文件,前者用于调试信息(是的,甚至发布版本可以在某种程度上调试),后者仅用于Visual Studio,它使用vs作为附件运行调试器更快(再次,发布与否)。
#3
Simply removing the files from the directories won't stop them from appearing in future builds. Check the pre and post build steps in the project properties. If you don't want symbols in release builds, disable the debug symbol link options in the project properties (but I would recommend keeping them unless you write perfect code).
简单地从目录中删除文件不会阻止它们出现在将来的版本中。检查项目属性中的前置和后置构建步骤。如果您不希望在发布版本中使用符号,请禁用项目属性中的调试符号链接选项(但我建议保留它们,除非您编写完美的代码)。
#1
By default release builds do create the pdb files, so it isn't unusual to see them in there. I'd assume the same is true of the vshost file. If you want to build without them bring up the projects settings (from the project's context menu in the solution explorer) go to the "build" tab, at the top ensure that you are looking at the release configuration and then click the "advanced" button at the bottom. In the new window that pops up there is a dropdown labelled "Debug Info", set this to none to disable the pdb creation.
默认情况下,发布版本会创建pdb文件,因此在那里看到它们并不罕见。我假设vshost文件也是如此。如果你想在没有它们的情况下构建项目设置(从解决方案资源管理器中的项目上下文菜单),请转到“构建”选项卡,在顶部确保您正在查看发布配置,然后单击“高级”底部的按钮。在弹出的新窗口中,有一个标记为“Debug Info”的下拉列表,将其设置为none以禁用pdb创建。
As for the references, that doesn't sound like correct behaviour, but bare in mind the they are recursive so if a projectA references projectB and projectB references mbunit then the mbunit dlls will be copied into any build folder for projectA. So it may be that you have missed one reference somewhere and this is propagating throughout your entire solution...?
至于引用,这听起来不是正确的行为,但是记住它们是递归的,所以如果projectA引用projectB和projectB引用mbunit,那么mbunit dll将被复制到projectA的任何构建文件夹中。所以可能是你错过了某个地方的某个参考,这是在整个解决方案中传播......?
Also ensure that you are rebuilding the solution rather than building - a build will not get rid of any files that already exist in the folder. Even better manually delete the bin and obj folder before you build to ensure you have a clean slate.
还要确保您正在重建解决方案而不是构建 - 构建不会删除文件夹中已存在的任何文件。甚至最好在构建之前手动删除bin和obj文件夹,以确保您有一个干净的平板。
Just done a quick test in Visual Studio and it looks like a vshost file is created for whichever project is set as your StartUp project in both debug and release nomatter what the debug info setting is. To stop this you need to uncheck the "Enable the Visual Studio hosting process" under the Debug tab of the project's settings.
刚刚在Visual Studio中进行了一次快速测试,它看起来像是在调试和发布中设置为StartUp项目的任何项目都创建了一个vshost文件,调试信息设置是什么。要停止此操作,您需要取消选中项目设置的“调试”选项卡下的“启用Visual Studio主机进程”。
#2
You can safely remove the .pdb files and the .vshost files, the former is for debugging information (yes, even release builds can be debugged to some degree) and the later is for visual studio only, it makes running with vs as an attached debugger faster (again, release or not).
您可以安全地删除.pdb文件和.vshost文件,前者用于调试信息(是的,甚至发布版本可以在某种程度上调试),后者仅用于Visual Studio,它使用vs作为附件运行调试器更快(再次,发布与否)。
#3
Simply removing the files from the directories won't stop them from appearing in future builds. Check the pre and post build steps in the project properties. If you don't want symbols in release builds, disable the debug symbol link options in the project properties (but I would recommend keeping them unless you write perfect code).
简单地从目录中删除文件不会阻止它们出现在将来的版本中。检查项目属性中的前置和后置构建步骤。如果您不希望在发布版本中使用符号,请禁用项目属性中的调试符号链接选项(但我建议保留它们,除非您编写完美的代码)。