NCrunch Forum
»
General Support
»
Build/Test Issues
»
System.Windows.Application Not Populated Under NCrunch
Rank: Member
Groups: Registered
Joined: 9/3/2014(UTC) Posts: 29 Location: Australia
Thanks: 4 times Was thanked: 3 time(s) in 3 post(s)
|
Inside a class library of a WPF app I am using the FindRecourse() method of System.Windows.Application.Current class. The code compiles and runs fine but NCrunch is reporting a NullReferenceException on this line. It would appear that System.Windows.Application isn't populated under Ncrunch execution. Would this be correct, and if it is how can I work around it?
Thanks for your help.
|
|
|
|
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,144
Thanks: 959 times Was thanked: 1290 time(s) in 1196 post(s)
|
Hi, thanks for posting.
Have you tried this code using any other test runner? My understanding is that usually the application object itself would be populated by the application bootstrap routine (i.e. Program.Start). You might need to add special setup code to your automated test to allow your code to work.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 9/3/2014(UTC) Posts: 29 Location: Australia
Thanks: 4 times Was thanked: 3 time(s) in 3 post(s)
|
Hi Remco, Thanks for your prompt reply. I tried running the tests with the NUnit test runner and got the same problem, the Application object wasn't populated and it threw the same NullReferenceException. I will try and find a solution for this.
Thanks again.
|
|
|
|
NCrunch Forum
»
General Support
»
Build/Test Issues
»
System.Windows.Application Not Populated Under NCrunch
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.NETThis page was generated in 0.026 seconds.