When I am using Microsoft workflow Foundation ncrunch is unable to build projects and return the following message:
C:\windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Xaml.targets: Extension 'Microsoft.Activities.Build.Validation.ValidationBuildExtension' threw an exception of type 'System.Xaml.XamlObjectWriterException' : 'The invocation of the constructor on type 'type' that matches the specified binding constraints threw an exception.'.
To reproduce it, you need 3 projects in a Solution:
Solution
---ActivityLib (contains Xaml activities)
---Consumer (also contains xaml activities that uses activity from ActivityLib)
---TestProject (Contains a test which test the activity)
When all references are equal NCrunch is able to build and execute the test, but as soon as ActivityLib uses a additional reference to any dll or nuget package which Consumer does not have. NCrunch is unable to build Consumer project.
I tested the same project with the test runner from resharper and they were able to build the project and to run the tests. So I guess it a kind of settings maybe to get it running? Does anybody can advice me to get NCrunch building the project.
Hi, thanks for sharing this issue. Does turning on compatibility mode for this solution make any difference here? I'm particularly interested in whether the 'Copy referenced assemblies to workspace' setting has any effect.
I found a solution for this problem, I did not tried your suggestion, yet. But what resolved my problem was to change the build architecture of the dependend project in my scenario (Activity lib) to the same build architecture x64. I guess the default value here is x86? I projects are all build in x64 so this seems to cause the problem.
I'm impressed you managed to figure this out from such an obscure error message. It's true that the NCrunch build system defaults to x86. This is due to historical reasons (MSBuild used to only run under x86, and weird things would happen otherwise). I guess there is here a build task that does not like x86. NCrunch itself has no issues with x64 being used in the build system, so as long as MSBuild and its tasks don't complain, everything should be fine here now.