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

Notification

Icon
Error

NCrunch cannot load project when using VLC binaries
TLogik
#1 Posted : Thursday, April 14, 2016 4:56:12 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/12/2016(UTC)
Posts: 9
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
I have a project where we are now using VLC downloaded from Nuget.
The project builds fine in VS 2015.
The project build fin on our buildserver that uses MSBuild.

NCrunch however fails to even load the project that uses the VLC libs.
It relates to an invalid path of a targets file that is used by VLC but that is wierd since other systems (see above) does not complain.

These are the libs used (direct from packages.config)
<package id="nVLC" version="2.1.0.3" targetFramework="net452" />
<package id="Vlc.DotNet.Core" version="2.1.115" targetFramework="net452" />
<package id="Vlc.DotNet.Core.Interops" version="2.1.115" targetFramework="net452" />
<package id="Vlc.DotNet.Forms" version="2.1.115" targetFramework="net452" />
<package id="VLC.Native" version="2.2.0.1" targetFramework="net452" />

NCrunch Version
2.20.0.4

And the error as reported by NCrunch

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 "[System.IO.Directory]::GetDirectories(*Undefined*packages, VLC.Native.*)" cannot be evaluated. Illegal characters in path. E:\tbl\gitlab\infomedia-backoffice-closedcaptions\packages\VLC.Native.2.2.0.1\build\VLC.Native.targets
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)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings)
at Microsoft.Build.Evaluation.Project..ctor(XmlReader xmlReader, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
at nCrunch.VSIntegration2010.MSBuildIntegration.BuildableProject2010.Initialise(BuildXml buildXml, FilePath projectFilePath)
at nCrunch.Compiler.RemoteBuildRunner.(FilePath ,   , String , String , DirectoryPath , String )
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture buildProcessProcessorArchitecture, DirectoryPath workspaceBasePath)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.[T](Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture buildProcessProcessorArchitecture, DirectoryPath workspaceBasePath)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(FilePath projectFilePath, BuildXml buildXml, String useBuildConfiguration, String useBuildPlatform, DirectoryPath solutionDir, String solutionName, List`1 importExpressionsToEvaluate, ProcessorArchitecture processorArchitecture, VisualStudioVersion vsVersion, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.(ProcessorArchitecture )
at nCrunch.Client.ComponentLoader.SnapshotComponentFactory.CreateSnapshotComponentFromXml(FilePath projectFilePath, BuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, ISnapshotConfig snapshotConfig, VisualStudioVersion vsVersion)

Regards
Thomas
Remco
#2 Posted : Thursday, April 14, 2016 7:06:44 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 Thomas,

Thanks for sharing this issue.

This problem looks to be caused by a bad evaluation sequence in NCrunch's interaction with MSBuild during project load. The VLC targets file includes a property that is evaluated before NCrunch sets the $(SolutionDir) property, and this causes the evaluation to fail.

I should be able to provide a fix for this in the next release of NCrunch, due out in the next few days.

Meanwhile, if you'd like to work around the problem, it should be possible to modify the build target file to avoid the early evaluation. Inside VLC.Native.targets, examine the following line:

<VlcPackageDir>$([System.IO.Directory]::GetDirectories('$(SolutionDir)packages', 'VLC.Native.*')[0])</VlcPackageDir>

It's possible to replace the $(SolutionDir) in this expression by inferring it from $(ProjectDir) instead. For example:

<VlcPackageDir>$([System.IO.Directory]::GetDirectories('$(ProjectDir)..\packages', 'VLC.Native.*')[0])</VlcPackageDir>

TLogik
#3 Posted : Thursday, April 14, 2016 7:20:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/12/2016(UTC)
Posts: 9
Location: Denmark

Was thanked: 2 time(s) in 2 post(s)
Thanks Remco
Ill take a look at it later today
Remco
#4 Posted : Friday, April 22, 2016 3:20:55 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)
A fix for this issue is now available in v2.21, released today - http://www.ncrunch.net/download
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.052 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download