开发者

CodedUI null reference exception even when object exists

开发者 https://www.devze.com 2023-02-04 05:27 出处:网络
I have created a coded ui test that checks something in my software. It worke开发者_JAVA百科d fine, but now I keep getting null reference exception when I try to interact with my UITestControls (that

I have created a coded ui test that checks something in my software. It worke开发者_JAVA百科d fine, but now I keep getting null reference exception when I try to interact with my UITestControls (that were generated in the uimap). The strange thing is, that the UITestControls 'Exist' property returns true, which means that the control had been found.

I've searched and found this topic: http://social.msdn.microsoft.com/Forums/en/vsautotest/thread/c2e6e5c3-2503-4506-9963-733fd84fbd25, But I have checked in my project, and the 'Copy Local' property of these assemblies is set to false.

I think that this exception first occurred after I have added an app.config file to my project. Maybe this might be the problem? If so, how can I fix this without deleting my app.config file?

Thanks!


I solved this problem for myself by:

  • setting my System and Microsoft DLLs Copy Local false. The asker did this already, this was important.
  • going to your bin/Debug (or bin/Release) folders and deleting the copies of the System and Microsoft DLLs that are still there! Copy Local may be false, but the DLLs are still there from when Copy Local was true!
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号