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

Notification

Icon
Error

Console execution troubles
berrndholz
#1 Posted : Wednesday, June 6, 2018 2:50:47 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/6/2018(UTC)
Posts: 4
Location: Germany

Hi,

I am trying to run NCrunch as a VSTS command line build step but always get errors:

The command line options are: "MySolution.sln" /c "MySolution.v3.ncrunchsolution.BuildServer" /o "%AGENT_BUILDDIRECTORY%\NCrunch\Output"

The forst error in the output window is:

Quote:
Not restoring NuGet packages for '...App.iOS.csproj' because package restore mode is disabled
Loading project: ...App.iOS.csproj
...
All projects have been loaded
ERROR: Unable to restore required Nuget packages for .NET Core test environment
NCrunch was unable to restore Nuget packages required to build a test environment for this project, due to an unspecified failure when invoking 'msbuild.exe /t:restore'
The following packages do not exist under the Nuget packages folder for the active user profile, yet they have been flagged by NCrunch as potentially needed for normal operation. NCrunch has attempted to restore these files via an MSBuild restore step, which has either failed or not returned the expected result. It's possible that these packages may not be needed for building projects or running tests in your environment. If you experience downstream problems with NCrunch on this solution, it is recommended you restore or download the packages manually.
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
System.Diagnostics.TraceSource v4.3.0
xunit.abstractions v2.0.1
xunit.runner.utility v2.2.0


NCrunch continues after that but it appears it cannot restore some required assemblies.

Later ncrunch.exe fails with exit code 1 after an Build error:

Quote:
ERROR (Build): XamarinApp.Android: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (1590): Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'nCrunch.TestRuntime.DotNetCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=01d101bf6f3e0aea'. Perhaps it doesn't exist in the Mono for Android profile?
Dateiname: "nCrunch.TestRuntime.DotNetCore.dll"


What am I doing wrong?

Regards
Bernd
Remco
#2 Posted : Wednesday, June 6, 2018 7:51:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi, thanks for sharing this issue.

The problem you're experiencing with the package restore is caused by the 'msbuild /t:Restore' failing when this step is executed by the console tool. It's possible you have the machine locked down so it's unable to access Nuget or there is otherwise something blocking the connection. If you copy over the packages listed into the console tool user's profile .nuget directory, all the required packages should then be present and you shouldn't experience any downstream problems from this step (even though it may still report the error).

Do you also experience the build errors when you run NCrunch over this solution under Visual Studio?
berrndholz
#3 Posted : Monday, June 11, 2018 9:51:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/6/2018(UTC)
Posts: 4
Location: Germany

Thank you for the quick reply.

Nuget is generally working since the rest of our build script (The machine is configured as a VSTS Build Agent) runs fine. Running msbuild /t:restore standalone also gives no error.
A subsequent run of NCrunch now produced a lot less errors so it seems to have something todo with the way ncrunch executes msbuild /t:restore

How do I create detailed logfiles for further analysis?

In VisualStudio NCrunch is running fine, at least on a developer machine. The issue I am facing is with the console only installation.

Regards
Bernd
Remco
#4 Posted : Monday, June 11, 2018 11:39:04 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Thanks Bernd. Do you have Visual Studio installed on your build agent? If so, does it run correctly or report a meaningful error?

The error is usually written to the log of the console tool, though it may be easier to find it in the NCrunch UI under VS.

I expect this is probably security/environment related. Check that the user profile being used to execute the console tool isn't being blocked by the local firewall. Also check that you don't have any other security software installed that may try to block an outgoing connection.

Note that if all required packages have been restored, NCrunch won't attempt to perform the restore step and the error shouldn't appear. Thus copying all the Nuget packages from a working dev machine may completely resolve the problem for you.
berrndholz
#5 Posted : Thursday, June 14, 2018 9:44:10 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/6/2018(UTC)
Posts: 4
Location: Germany

Hi,

I do now overcome the first error by installing the required assemblies in a separate build step.

I realized, the second error comes from missing Xamarin support. However right now this is not a severe issue for us so I tried to ignore building the affected projects. I created a file "XamarinApp.Android.v3.ncrunchproject" in the project folder with the following content:

Quote:
<ProjectConfiguration>
<Settings>
<IgnoreThisComponentCompletely />
<HiddenComponentWarnings />
</Settings>
</ProjectConfiguration>


Unfortunately I still get the same error. It appears the configuration is wrong or not read at all.

Any hints?

Regards
Bernd
Remco
#6 Posted : Thursday, June 14, 2018 10:15:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Bernd,

If possible, I'd suggest creating the configuration file using the NCrunch GUI, as it can be difficult to troubleshoot if it doesn't match the tool's rather strict expectations.

To ignore the component, you'll need to set the 'IgnoreThisComponentCompletely' setting to 'True', i.e.: <IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely>.

If using the configuration UI isn't an option, note that you can still use it on a seperate project or solution to create the config file, then just copy this over or rename it for the appropriate project.
berrndholz
#7 Posted : Thursday, June 14, 2018 1:58:00 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/6/2018(UTC)
Posts: 4
Location: Germany

Okay, thats been it. With the correct XML syntax NCrunch is running fine. However we are hoping for full Xamarin support in the future.

Thank you for your support.

Bernd
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.054 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download