如何让我的 VS2010 安装项目在打开解决方案时不出现错误?

发布于 2024-11-25 06:36:42 字数 321 浏览 1 评论 0原文

我有几个项目的解决方案。其中一些(2)项目是安装项目。每当我打开解决方案时,我都会收到如下错误:

错误 16 无法找到源文件“Z:...\Remotion.Data.Linq.dll” 对于程序集“Remotion.Data.Linq.dll”,位于 '[TARGETDIR]' Z:...\CirrusNodeServiceSetup.vdproj CirrusNodeServiceSetup

通过执行构建或“触摸”(用鼠标)安装项目中的依赖项文件夹,可以消除这些错误。

有什么办法可以让这种奇怪的行为停止吗?

I have a solution with a couple of projects. Some(2) of these projects are setup projects. Whenever I open the solution I get errors like the following:

Error 16 Unable to find source file 'Z:...\Remotion.Data.Linq.dll'
for assembly 'Remotion.Data.Linq.dll', located in
'[TARGETDIR]' Z:...\CirrusNodeServiceSetup.vdproj CirrusNodeServiceSetup

These errors can be made to go away by either doing a build or by 'touching'(with my mouse) the dependencies folders in the setup projects.

Is there any way to make this weird behavior stop?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

§对你不离不弃 2024-12-02 06:36:42

是的,显然有办法。不要引用磁盘文件夹或网上邻居中的库。

正确的方法是在解决方案文件所在的位置创建一个“依赖项”文件夹(无论您喜欢什么名称)。将每个外部资源复制到该文件夹​​中并从那里引用它。

然后记住将新文件夹以及您将放入其中的所有内容添加到版本控制(SVN、HG 等)中,以便当源文件被提取到另一台计算机时,所有必需的依赖项都将在那里。

编辑:需要明确的是,这适用于不属于网络框架的库,这意味着它们不在 GAC 中。您应该始终引用 GAC 中的 CLR 库。

Yes there's clearly a way. Don't reference libraries from your disk folders or network places.

The right approach is to create a "Dependencies" folder (call it whatever you like) in the same place as where your solution file is. Copy in that folder every external resource and reference it from there.

Then remember to add that new folder and everything you will put in there to your versioning (SVN, HG, etc) so when the sources will be extracted to another machine, all the required dependencies will be there.

EDIT: just to be clear, this applies to libraries that are not part of the net framework, meaning they are not in the GAC. You should always reference CLR libraries from the GAC.

惟欲睡 2024-12-02 06:36:42

删除安装项目源文件夹上的只读属性为我解决了这个问题。

Removing the Read-Only attribute on the setup project's source folder fixed it for me.

-小熊_ 2024-12-02 06:36:42

在谷歌搜索时遇到这个答案,并想添加我的答案,因为问题会导致相同的错误消息:

在调试和发布版本之间切换时,每种构建类型的构建配置都不同。调试会构建,发布不会,反之亦然。通过“解决方案”>“发布/调试”更改构建配置以匹配属性解决了这个问题。

Came across this answer while googleing and wanted to add my answer as the problem results in the same error message:

When toggling between Debug and Release builds, the build configuration was different for each build type. Debug would build, release wouldn't and vice versa. Changing the build configuration to match in Release / Debug via Solution > Properties resolved the issue.

别把无礼当个性 2024-12-02 06:36:42

我只是发布 Rich Shealer 上面的评论,因为这对我有用,而且确实应该如此一个答案:

重建解决方案并不能清除错误,但只需扩展安装项目下的“检测到的依赖项”文件夹即可清除该错误。关闭“文件系统(设置)”选项卡(当您查看“检测到的依赖项”文件夹时会打开该选项卡),然后重新保存解决方案即可将其清除。

奇怪的是,我没有任何更新或类似的事情发生。但我最近刚刚安装了 Office 2010,并特意选择不获取自动更新。不确定这是否与此有关,但很高兴修复起来又快又容易。

I'm just posting Rich Shealer's comment from above as that was what worked for me and it really should be an answer:

Doing a rebuild of the solution did not clear the error, but simply expanding the Dectected Dependencies folder under the Setup project does. Closing the File System (Setup) tab, which opens when you view the Dectected Dependenciesfolder, and resaving the solution clears it for me.

Curiously, I do not have any updates or anything like that going on. But I had just recently installed Office 2010 and specifically chose not to get automatic updates. Not sure if that had anything to do with, but glad it was quick and easy to fix.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文