Hi,
I'm getting this in VS2013:
System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The expression "[MSBuild]::MakeRelative(E:\MyProject\private\, '')" cannot be evaluated. Parameter "path" cannot have zero length. E:\MyProject\Environment.props
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Evaluation.Expander`2.Function`1.Execute(Object objectInstance, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation)
at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties)
at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluatePropertyElement(ProjectPropertyElement propertyElement)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluatePropertyGroupElement(ProjectPropertyGroupElement propertyGroupElement)
The offending line in Environment.props appears to be
<_ServiceSpaceRootRelative>$([MSBuild]::MakeRelative($(INETROOT)\$(_ServiceSpaceRootReplace)\, $(MSBuildProjectFullPath)))</_ServiceSpaceRootRelative>
The project itself loads and builds correctly in VS/msbuild.
Any ideas?
Remco NCrunch Developer
#9015
21 Jul 2016 01:55 UTC
Hi,
Thanks for sharing this issue.
When NCrunch builds your project, it does so via the MSBuild API. The manner in which this happens affects some of the global build properties and prevents them from being evaluated very early when working with the project. This means the values just aren't available for certain functions (such as MakeRelative).
I've noted this down to see if I can find a workaround in a future version of NCrunch. For the time being, I recommend looking at other ways you may be able to construct this path. Is there another way you can solve this problem without using $(MSBuildProjectFullPath) in an inline expression?
Thanks for sharing this issue.
When NCrunch builds your project, it does so via the MSBuild API. The manner in which this happens affects some of the global build properties and prevents them from being evaluated very early when working with the project. This means the values just aren't available for certain functions (such as MakeRelative).
I've noted this down to see if I can find a workaround in a future version of NCrunch. For the time being, I recommend looking at other ways you may be able to construct this path. Is there another way you can solve this problem without using $(MSBuildProjectFullPath) in an inline expression?
Post a reply
Log in to reply.