Visual Studio 清理解决方案不会删除所有被移动的 dll/项目引用
我有一个 VS 2008 C# Web 应用程序,其中包含一堆对自定义 dll 的项目引用。这些都位于 Web 项目的相对路径中。最近我注意到 Clean Solution 从 Web 应用程序的 bin\debug 文件夹中删除了一些(但不是全部)dll。例如:
<Reference Include="TowerCo.Utilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Components\TowerCo.Utilities\bin\Debug\TowerCo.Utilities.dll</HintPath>
</Reference>
<Reference Include="TowerCo.WebControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Components\TowerCo.WebControls\bin\Debug\TowerCo.WebControls.dll</HintPath>
</Reference>
第一个可以正常工作(clean 会清除它,在重建时将新版本复制到 Web 项目),但第二个则不能。副作用是我不会自动获取依赖项的更改。
感谢您的任何帮助。
I have a VS 2008 C# web app with a bunch of project references to custom dlls. These are all at a relative path from the web project. Recently I've noticed that Clean Solution removes some, but not all, of the dlls from the web app's bin\debug folder. For example:
<Reference Include="TowerCo.Utilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Components\TowerCo.Utilities\bin\Debug\TowerCo.Utilities.dll</HintPath>
</Reference>
<Reference Include="TowerCo.WebControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Components\TowerCo.WebControls\bin\Debug\TowerCo.WebControls.dll</HintPath>
</Reference>
The first one works normally (clean cleans it, new versions copied to web project on rebuild) but the second does not. A side effect is that I don't automatically pick up changes to the dependency.
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它似乎只删除它“知道”的文件。
例如,旧的库文件和重命名项目后的旧引用仍然存在。很奇怪。我一直认为“干净”只是一个简单的删除 - 我不太明白为什么不是。如果有疑问,请手动检查每个文件夹。
It only seems to delete files it 'knows about'.
For instance old library files, and old references after having renamed projects are still there. Very strange. I always assumed 'Clean' was just a straightforward delete - and I don't quite understand why it isn't. Go in and check each folder by hand if in doubt.
有时,如果版本相同,VS 不会选择最新的 dll。尝试更改 AssemblyInfo.cs 中的版本,它应该可以工作。
过去,当我依赖大小/时间戳时,我遇到了同样的问题,但后来我意识到,通过更改版本,Studio 会删除旧的 DLL 并复制新的 DLL。
Sometime VS doesn't pick the latest dll if the version is same. Try changing your version in AssemblyInfo.cs and it should work.
In past, I faced the same issue when I was relying on size/timestamp but I later realized that by changing the version, Studio removes the older DLLs and copies the new DLLs.