[13:56:49.8953-Core-8] All projects have been loaded
[13:56:49.8953-Core-8] ERROR (Internal): System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at nCrunch.Core.PlatformTypes.DotNetCorePlatformType.☻()
at nCrunch.Core.PlatformTypes.DotNetCorePlatformType.AllProjectsLoaded()
at nCrunch.Client.Synchronisation.SnapshotSynchroniser.☻()
at nCrunch.Client.Synchronisation.SnapshotSynchroniser.☻(DteProjectsAddedWithBuildXmlEvent ☻)
I get above error all of the sudden when running on TeamCity, the execution seems to freeze after above output. Tried changing cache and workspace locations which didn't help. Cleaned the build working directory didn't help. I'm out of ideas :/.
Hi, thanks for sharing this problem. I can see how this is happening in NCrunch and it should be easy to fix it, but this looks like a downstream problem from something else. This exception should only happen if you are running NCrunch over a solution with no projects able to be processed (i.e. all supported projects are ignored).
In theory, if/when I fix this problem, NCrunch will likely just complete its execution run and return no results. Does this match your expectation given the structure/configuration of your solution?
Remco wrote:Hi, thanks for sharing this problem. I can see how this is happening in NCrunch and it should be easy to fix it, but this looks like a downstream problem from something else. This exception should only happen if you are running NCrunch over a solution with no projects able to be processed (i.e. all supported projects are ignored).
In theory, if/when I fix this problem, NCrunch will likely just complete its execution run and return no results. Does this match your expectation given the structure/configuration of your solution?
Hrm no, I have a lot of projects in this solution :|.
GreenMoose wrote:
Hrm no, I have a lot of projects in this solution :|.
You may need to apply some deductive logic here so we can work out why the console tool won't load the projects. A few interesting things to check:
- Does the console tool also behave this way when used on the same solution on your dev machine?
- Does this happen only for a specific solution, or also others?
- Does it happen for a minimal dummy test solution?
- This may be harder to test (depending on your setup), but does this happen if the TeamCity server tries to open the solution in VS and process it using the NCrunch VS plugin?
Ok I found the issue, sortof. The solution consisted both of vs2017 and vs2015 projects (in order to keep compatibility with vs2015) along with a global.json to set the framework version to old core release. (This worked fine with NCrunch)
I later introduced some vs2017-only projects, and for some reason this seems to cause NCrunch to fail. After cleaning up all vs2015 leftovers NCrunch on TeamCity is happy again :).
GreenMoose wrote:
I later introduced some vs2017-only projects, and for some reason this seems to cause NCrunch to fail. After cleaning up all vs2015 leftovers NCrunch on TeamCity is happy again :).
Interesting ... How did this cause NCrunch to fail? Did it just fail to recognise all the projects in the solution? Or was it kicking up errors?
GreenMoose wrote:
I later introduced some vs2017-only projects, and for some reason this seems to cause NCrunch to fail. After cleaning up all vs2015 leftovers NCrunch on TeamCity is happy again :).
Interesting ... How did this cause NCrunch to fail? Did it just fail to recognise all the projects in the solution? Or was it kicking up errors?
No it froze after outputting above exception. Not sure if the project mix was the actual reason though but since we don't really need vs2015 that was the easiest solution to try with. (The solution built fine previously when I hadn't introduced new vs2017 projects).
*Edit: Also I could not repro it locally (where I have vstudio2017 installed) so I guess it is related to settings in global.json along with the specific SDKs installed on built agent.
GreenMoose wrote:
*Edit: Also I could not repro it locally (where I have vstudio2017 installed) so I guess it is related to settings in global.json along with the specific SDKs installed on built agent.
NCrunch itself no longer cares about global.json (earlier DNX integrated builds did), though I presume this file could have some affect on the build system, which NCrunch does use when trying to load projects. If the build system wasn't behaving as expected, it's possible NCrunch was dropping the projects as being unable to be loaded and then running into its unplanned explosion downstream. If this is the case, then fixing the downstream explosion you've originally reported here should allow the engine to progress further and report these problems in a more sensible way.