VS2012 $(exists) 只接受标量值 [英] VS2012 $(exists) only accepts scalar values

查看:19
本文介绍了VS2012 $(exists) 只接受标量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这与其说是编程错误,不如说是构建错误.我从来没有太多理由让我的手弄脏构建,所以这个错误让我感到困惑.

Okay, this is more of a build error than a programming error. I have never had much reason to get my hands dirty with builds, so this error is baffling me.

我试过在谷歌上搜索这个错误,但结果很少,答案要么不存在,要么无法理解,要么不适用.

I have tried googling this error with little results, the responses are either nonexistent, incomprehensible or not applicable.

错误是:

The "exists" function only accepts a scalar value, but its argument 
"$(PackageSourceManifest)" evaluates to "[same path];[same path]" which is not a 
scalar value. C:Program Files(x86)MSBuildMicrosoftVisualStudio
                                   v10.0WebMicrosoft.Web.Publishing.targets

无论如何,我深入研究了 Microsoft.Web.Publishing.targets 并找到了出错的那一行.我在尝试查看是否可以找到任何我可以解决的问题的地方进行了详细的构建.

Anyway, I dug into Microsoft.Web.Publishing.targets and I found the line where it is erroring out. I have verbose builds on where I was attempting to see if I could find anything that stuck out to me that I could fix.

没什么.

我在谷歌上搜索了如何更改包源清单,我查看了构建属性,我搜索了源清单,甚至搜索了源清单,什么都没有.也许我看起来太难了,或者我只是不知道要寻找什么.

I have googled how to change Package Source Manifests, I have looked in Build Properties, I have searched for a source manifest or even something that says source manifest, nothing. Maybe I am looking too hard or maybe I just don't know what to look for.

有关如何解决此问题以及导致此问题的原因有任何想法吗?

Any ideas on how to fix this and what caused this?

推荐答案

打开您的 .csproj 文件并查找任何重复的导入标记.

就我而言,.csproj 有两行如下:

In my case the .csproj had two lines like this:

<Import Project="$(MSBuildExtensionsPath)MicrosoftVisualStudio
v10.0WebApplicationsMicrosoft.WebApplication.targets" />

删除其中一个即可解决问题.

Remove one of them fixed the problem.

这篇关于VS2012 $(exists) 只接受标量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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