I've updated my projects to target .NET framework 4.6.1, and NCrunch builds the tests but fails to run them, giving the error:
An error occurred while analysing this project after it was built: System.BadImageFormatException: Could not load file or assembly 'file:///C:\MyProject\bin\Debug\MyProject.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'file:///C:\Users\User\AppData\Local\NCrunch\8880\155\MyProject\bin\Debug\MyProject.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(TestFrameworkDescription[] applicableFrameworks, ComponentUniqueName testComponentUniqueName)
Is there some NCrunch configuration setting I need to change, or does this require an updated version of NCrunch?
I had thought that 4.6.1 was an over-the-top replacement for 4.6, but it looks like it's a whole new version of the framework that will need its own task runner. This means to get 4.6.1 to run inside your test environment, we'll need to add a new task runner to NCrunch.
I'll ensure this is in the next release. For the time being, I recommend sticking with v4.6 on your test projects.
Just a note on the "sticking with v4.6 on your test projects", this will require that your main projects are v4.6 as well, since v4.6 projects are not able to reference v4.6.1 projects.
I had thought that 4.6.1 was an over-the-top replacement for 4.6, but it looks like it's a whole new version of the framework that will need its own task runner. This means to get 4.6.1 to run inside your test environment, we'll need to add a new task runner to NCrunch.
I'll ensure this is in the next release. For the time being, I recommend sticking with v4.6 on your test projects.
I am on 2.19 and am getting the following error after updating ncrunch:
An error occurred while analysing this project after it was built: NCrunch encountered an unexpected error occurred while building an environment to analyse an assembly: System.Exception: The requested version of the .NET framework, 'Framework461' is not installed on this system
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(ProcessorArchitecture , ProcessLoadParameters )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client)
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.(Boolean , FilePath , GridClientId , CustomEnvironmentVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()
When can the rest of my team see this as an update on your site or within vs?
I noticed a new alert though. I am using funnel because I work in a large solution so I unload projects that are not relevant to what I am currently working on. Is there a setting in ncrunch to ignore unloaded projects when initializing?
There are projects in this solution that have not been reported as loaded by the IDE within the 60 second timeout period allowed during NCrunch initialisation. It is possible that these projects are of an unusual type and NCrunch has been unable to correctly detect them, or alternatively you may be experiencing IDE solution loading times that are much higher than normal.
If these projects are not required for your NCrunch session, it is recommended that you ignore them using the NCrunch 'Ignore this component completely' configuration setting. This will result in faster NCrunch initialisation times as the engine no longer needs to wait for data related to these projects.
The following projects exist in this solution but could not be resolved by NCrunch during initialisation:
...
bryanjoseph wrote:
When can the rest of my team see this as an update on your site or within vs?
This will happen when 2.20 is officially released, which unfortunately can't be without some level of ceremony. Right now the 2.20 build only contains the fix for the above problem, which isn't required for all environments. The build you're using is stable enough to be production ready, so I'd recommend to the rest of your team to simply install this update using the above links.
bryanjoseph wrote:
I noticed a new alert though. I am using funnel because I work in a large solution so I unload projects that are not relevant to what I am currently working on. Is there a setting in ncrunch to ignore unloaded projects when initializing?
There are projects in this solution that have not been reported as loaded by the IDE within the 60 second timeout period allowed during NCrunch initialisation. It is possible that these projects are of an unusual type and NCrunch has been unable to correctly detect them, or alternatively you may be experiencing IDE solution loading times that are much higher than normal.
If these projects are not required for your NCrunch session, it is recommended that you ignore them using the NCrunch 'Ignore this component completely' configuration setting. This will result in faster NCrunch initialisation times as the engine no longer needs to wait for data related to these projects.
The following projects exist in this solution but could not be resolved by NCrunch during initialisation:
...
2.19 introduced changes to the way that NCrunch handles projects that are not reported by the IDE during initialisation. This has recently become a big problem with the release of VS2015, as VS can now take much, much longer to initialise and fully load all projects (especially when other 3rd party VS packages are installed). The key issue is that when a project is unloaded, VS simply won't report it as existing within the solution in an understandable state. From VS2012, projects are loaded asynchronously and there is no determined point at which all projects are said to be loaded. To deal with this, NCrunch considers your solution (.sln) file to be the main source of information on which projects exist in the solution and still need to be loaded. The 60 second timeout is a fallback method to catch situations where projects exist in the solution and are not reported by VS, as without this NCrunch would simply hang forever waiting for the unloaded projects to be reported.
So to cut a long story short, it's an issue caused by the limitations of VS integration. You have three options here:
1. Set the 'Ignore this project completely' NCrunch project-level configuration setting to 'True' for projects that you leave unloaded in the IDE. In this way, the engine knows not to expect these projects and won't wait for the IDE to report them.
2. Avoid working with unloaded projects in the solution. Consider creating separate solutions to represent different views of the software you're working on
3. Ignore the warning and live with slightly higher initialisation times for NCrunch. It will still work, and will be stable - but it will wait for 60 seconds during its initialisation for the missing projects to be reported.
Regarding unloaded projects. I will be going with option #3. A suggestion for another option might be to add a configuration to set the amount of time you have to wait for projects to load. I would be happy with half that time or less.
bryanjoseph wrote:Regarding unloaded projects. I will be going with option #3. A suggestion for another option might be to add a configuration to set the amount of time you have to wait for projects to load. I would be happy with half that time or less.
I was just thinking the exact same thing. I don't doubt that others will also be hit with this. I've added it in the backlog for the next release :)
Dustin Moris Gorski wrote:I am keen on this fix as well. Could you not just release a hotfix 2.19.1 which includes only this change?
Sorry - I'm not sure exactly what you're asking here ... Do you mean a fix for .NET 4.6.1 support? This is essentially what the 2.20 build above is - I think the 4.6.1 fix is the only thing in this build.
I am having this issue as well. I cannot test NET 4.61. The link provided above for 2.20 does not work, so I can't use that. Could that link be fixed? Or is 2.20 close to being released?
Can you share your experiences with the 2.20 link above? On all angles I've tested, this does introduce support for 4.6.1. I'm concerned you may be encountering a different problem with the build.
I was actually having trouble downloading the files (so I never got to the part of using this version of NCrunch with 4.6.1).
However, based on your response, I got suspicious and copied the link into Firefox (rather than clicking it right here in the post within Chrome) and that worked, so I now have this version. If I do have troubles, I'll let you know.