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

Notification

Icon
Error

Upgraded Web Project Not Building
simongh
#1 Posted : Sunday, June 03, 2018 10:25:08 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/20/2017(UTC)
Posts: 5
Location: United Kingdom

We have a fairly large solution of 40 projects including unit tests & 3 web projects. I'm trying to upgrade the projects to the latest format, ie changing the tooling version to 15 so we can use ProjectReference for NuGet packages, rather than package.config. But I've run into a problem with NCrunch.

We use the NCrunch Console tool with Teamcity. The solution builds fine on my machine, both by Visual Studio & NCrunch. However on the build server MSBuild works fine, NCrunch does not. It seems to ignore every NuGet reference in the main web project. All the projects build just fine, both locally & in TC. This one web project however fails in TC. The web project primarily contains WebApi & MVC controllers. Every single file reports an error of type or namespace not found related to MVC & WebApi types which come from NuGet.

I've checked the references and they are most definitely there. NCrunch VS plugin builds the project fine. MSBuild builds just fine. NCrunch Console 3.16.1 refuses to. Any ideas what I need to look for?
Remco
#2 Posted : Sunday, June 03, 2018 11:49:32 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,234

Thanks: 691 times
Was thanked: 843 time(s) in 803 post(s)
Hi, thanks for sharing this issue.

This feels like it could be a package resolution issue of some kind. If the solution works fine under NCrunch on your workstation, but doesn't work using the console tool on the build server, it could be something in the environment causing this.

If you try running the console tool locally on your dev machine (where I'm assuming the NCrunch VS client works fine), do you experience the problem?

Also, I do recommend moving up to v3.17 when you get the chance.
simongh
#3 Posted : Monday, June 04, 2018 2:02:07 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/20/2017(UTC)
Posts: 5
Location: United Kingdom

Upgraded to 3.17, no joy. Ran the the build using the console tool on my machine and it worked. Trying to run the console tool on the build agent by hand also fails - but in a different way. This time csc.exe failed with -532462766

[12:54:00.4344-?-1] Reporting engine execution results
Result: BuildFailure
[12:54:01.575-?-1] Shutting down engine
[12:54:05.4344-Core-29] ERROR (Internal): System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.ToArray()
at nCrunch.Client.Model.Persistence.ClientModelPersister.(PersistentModelData , DirectoryPath , FilePath )
at nCrunch.Client.Model.Persistence.ClientModelPersister.SaveData(PersistentModelData modelData)
at nCrunch.Client.Model.ClientModelSynchroniser.(SystemDisabledEvent )

[12:54:05.4813-Core-29] Cleaning up workspace: d:\ncrunch\3268\1
Remco
#4 Posted : Monday, June 04, 2018 10:28:37 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,234

Thanks: 691 times
Was thanked: 843 time(s) in 803 post(s)
Try the following:

- Wipe the NCrunch cache file as it exists on the build server
- Ensure you have a fresh checkout of the source code on the build server (remove any cached copies)
- Try configuring your build server to use a local user to run the console tool, which has access to the desktop/WindowsGUI
- Ensure the build server has the same exact versions of .NET Core, the .NET Framework and Visual Studio (or matching build tools) installed as your client machine
- From your client machine, copy the contents of your user's .nuget packages directory over to the build server's user profile. This is to make sure you're using the same packages on the build server as you have on your local machine, and everything is aligned

If you still get the OutOfMemory exception after this, try watching the NCrunch.exe process during the run. Does its memory consumption go over the 2GB mark? Do you see any indication to suggest that this is being loaded as an x86 process? (It should normally be x64).

Also, do let me know if you're using distributed processing as there may be other things to check if you have resolution issues on grid servers.
Users browsing this topic
Guest (2)
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.029 seconds.