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 error is:
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)\MSBuild\Microsoft\VisualStudio\
v10.0\Web\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.
Nothing.
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?
Open your .csproj file and look for any duplicated import tag.
In my case the .csproj had two lines like this:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio \v10.0\WebApplications\Microsoft.WebApplication.targets" />
Remove one of them fixed the problem.
Had the same issue in VS 2012 -
Error 48 04115: The "exists" function only accepts a scalar value, but its argument "@(_UnmanagedRegistrationCache)" evaluates to "obj\TheQueueData.sqlproj.UnmanagedRegistration.cache;obj\TheQueueData.sqlproj.UnmanagedRegistration.cache" which is not a scalar value. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1091 7 TheQueueData
Closing and re-opening the solution did the trick for me.
I had the same issue, due to improper import of $MSBuildExtensionsPath32$. It's obvious that v10.0 is for VS2010 whereas you're on VS2012 (v11.0).
Therefore, change your import to:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" />
For other, if you have VS2013 (v12.0), you can change it to:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" />
Note: if your remove this line like @giacomelli suggested, you'll not be able to use define your custom target file.
From MSDN : MSBuildExtensionsPath32
http://msdn.microsoft.com/en-us/library/ms164309.aspx
Introduced in the .NET Framework 4: there is no difference between the default values of MSBuildExtensionsPath and MSBuildExtensionsPath32. You can set the environment variable MSBUILDLEGACYEXTENSIONSPATH to a non-null value to enable the behavior of the default value of MSBuildExtensionsPath in earlier versions. In the .NET Framework 3.5 and earlier, the default value of MSBuildExtensionsPath points to the path of the MSBuild subfolder under the \Program Files\ or \Program Files (x86) folder, depending on the bitness of the current process. For example, for a 32-bit process on a 64-bit machine, this property points to the \Program Files (x86) folder. For a 64-bit process on a 64-bit machine, this property points to the \Program Files folder. Do not include the final backslash on this property. This location is a useful place to put custom target files. For example, your target files could be installed at \Program Files\MSBuild\MyFiles\Northwind.targets and then imported in project files by using this XML code:
I think this happened to me when I a tried to Web Publish a project in VS2012 that had originally been a VS2010 project. So recreating the project in VS2012 is a way to cure it.
Or as @Giacomelli mentions, deleting the reference to the v10.0 targets. Note that V10.0
= VS2010
and v11.0
= VS2012
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With