Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

InvalidProjectFileException on load
jyeohamilton
#1 Posted : Thursday, July 21, 2016 12:48:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/21/2016(UTC)
Posts: 1

Thanks: 1 times
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
#2 Posted : Thursday, July 21, 2016 1:55:02 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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?
1 user thanked Remco for this useful post.
jyeohamilton on 7/21/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download