Visual Studio 2015 未检测到构建的项目,在错误的目录中查找输出 [英] Visual Studio 2015 doesn't detect built project, looks for output in wrong directory

查看:29
本文介绍了Visual Studio 2015 未检测到构建的项目,在错误的目录中查找输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我要求 VS 构建解决方案时,我都会构建多个项目.构建日志中的相关行:

I have several projects that get built every time I ask VS to build the solution. The relevant line from the build logs:

项目 'MyProject' (SolutionFolder\MyProject\1.0.0\MyProject)' 不是最新的.缺少输出文件d:\...\MyProject\1.0.0\bin\MyProject.dll".

Project 'MyProject' (SolutionFolder\MyProject\1.0.0\MyProject)' is not up to date. Missing output file 'd:\...\MyProject\1.0.0\bin\MyProject.dll'.

MyProject.dll 存在,但不是在 ...\1.0.0\bin\MyProject.dll 中,而是在 d:\...\MyProject\1.0.0\objd\amd64\MyProject.dll:输出目录而不是 bin 目录.VS 找错了地方,找不到 DLL,每次都重建项目.输出路径设置为bin/".构建5个项目大约需要30秒;这很烦人,我想找回那段时间,但这不是世界末日.

MyProject.dll exists, but instead of in ...\1.0.0\bin\MyProject.dll it's in d:\...\MyProject\1.0.0\objd\amd64\MyProject.dll: the output directory instead of the bin directory. VS is looking in the wrong place, failing the find the DLL, and rebuilding the project every time. The OutputPath is set to "bin/". It takes about 30 seconds to build the 5 projects; it's annoying, and I'd like to get that time back, but it's not the end of the world.

其他可能相关的信息:

  • 该项目位于三层解决方案文件夹中:SolutionFolder/MyProject/1.0.0
  • 该项目的输出被其他类似项目使用.MyProject.dll 显示在其他项目的 bin/文件夹中,但这些其他项目在该文件夹中也没有自己的 DLL.所以我遇到了四次这个问题:一次是针对没有依赖项的项目,另外三个项目使用了第一个.
  • 这些是使用 TypeScript 的 Web 应用程序项目.项目类型 GUID 为 {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}

我怎样才能让 Visual Studio 识别出它已经构建了这些项目,以便它们仅在实际发生变化时才重新构建?

How can I get Visual Studio to recognize that it's already built these projects, so that they'll only rebuild when something actually changes?

推荐答案

清理解决方案,关闭解决方案和 VS 也.

Clean the solution, close solution and VS also.

然后删除SUO文件和bin和obj文件夹.

打开 VS.

重新引用 DLL 等.更改 csproj 文件中的引用路径.

Re-ref the DLL, etc, etc.. Change ref path in csproj file(s).

这篇关于Visual Studio 2015 未检测到构建的项目,在错误的目录中查找输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆