问题
I am testing an application which loads a powerpoint (.ppt or .pptx) file insert it. Application gives same look an feel like powerpoint with some extra setting when the file is loaded inside the application. When I try to automate the application, I click a button to load the powerpoint file into the application. After the loading process white framework fails to continue playback.
When I restart the same test again I got "NonComVisibleBaseClass was detected" exception.
I can only continue my testing after restarting the entire application. Does anyone face this kind of issue? your answers will really helpful to continue my testing.
回答1:
It's known issue.
http://social.msdn.microsoft.com/Forums/en-US/27c3bae8-41fe-4db4-8022-e27d333f714e/noncomvisiblebaseclass-was-detected?forum=Vsexpressvb
- Navigate to Debug->Exceptions...
- Expand "Managed Debugging Assistants"
- Uncheck the NonComVisibleBaseClass Thrown option.
- Click [Ok]
回答2:
I stumbled upon this page after having the same problem. Although I'm not sure this solution may help you it helped me and maybe can be useful to someone else.
My WPF application needed to run with elevated privileges and if I tried to run VS without elevated privileges my tests broke with the aforementioned error. What I did was simply restar VS as Administrator and the tests started working.
One thing I noticed was that when I was running without elevated privileges the Window.Framework was 'Win32' and the Window.Items was empty. After running VS as Administrator The Framework propery was 'Wpf' and the Items list was filled correctly. I don't know what is the real cause of the problem here. But it worked for me and maybe it'll work for someone else.
来源:https://stackoverflow.com/questions/22369814/ui-automation-white-framework-noncomvisiblebaseclass-was-detected-exception