unable to select File in menu bar with visual studio 2005

Nov 3, 2008 at 5:01 PM
Edited Nov 3, 2008 at 5:05 PM
Hi all,
I am after testing a plugin of Visual Studio 2005. But I can't do File-> new project with white framework. Visual studio is being launched by this API as expected ! But I can't open the dialog to create a new project !

Basically i have followed one example from this forum.
The code is the following :

       public void BasicVisualStudiotest()
        {
           string Vs2005Application = IOUtilities.PathCombine("C:\\Program Files", "Microsoft Visual Studio 8",
    "Common7", "IDE", "devenv.exe");
            Application app = Application.Launch(Vs2005Application);
            Core.UIItems.WindowItems.Window form = app.GetWindow("Start Page - Microsoft Visual Studio", InitializeOption.NoCache.AndIdentifiedBy("devenv"));
            Core.UIItems.WindowStripControls.MenuBar menubar = form.MenuBar;          
            Core.UIItems.MenuItems.Menu menu = menubar.MenuItem("File");
            menu.Click();
            app.Kill();
}
It is failing when exercing Core.UIItems.MenuItems.Menu menu = menubar.MenuItem("File");
The error is :

SystemTest.EndToEnd.Corba.BasicVisualStudiotest : Bricks.BricksException : Error invoking MenuBar.MenuItem
  ----> Core.Factory.UIItemSearchException : Could not find Menu File

   at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfo, Object[] arguments) in D:\bricks\Bricks.RuntimeFramework\ReflectedObject.cs:line 69
   at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocation, InterceptContext interceptedContext) in D:\bricks\Bricks\DynamicProxy\DynamicProxyInterceptors.cs:line 20
   at Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation) in d:\white-os\Core\Interceptors\CoreInterceptor.cs:line 29
   at Castle.DynamicProxy.AbstractInvocation.Proceed() in d:\OSS\Castle\Tools\Castle.DynamicProxy2\Castle.DynamicProxy\AbstractInvocation.cs:line 165
   at MenuBarProxy9db9f9baf7a4487db4cf235319b2ab45.MenuItem(String[] path)
   at SystemTest.EndToEnd.Corba.BasicVisualStudiotest() in C:\data\svnviews\msft_clean_30oct\ArtixAdapter\SystemTest\EndToEnd\Corba.cs:line 99
--UIItemSearchException
   at Core.UIItems.MenuItems.Menus.Find(String[] path) in d:\white-os\Core\UIItems\MenuItems\Menus.cs:line 43
   at Core.UIItems.WindowStripControls.MenuBar.MenuItem(String[] path) in d:\white-os\Core\UIItems\WindowStripControls\MenuBar.cs:line 19
   at Bricks.RuntimeFramework.ReflectedObject.Invoke(MethodInfo methodInfo, Object[] arguments) in D:\bricks\Bricks.RuntimeFramework\ReflectedObject.cs:line 69
   at Bricks.DynamicProxy.DynamicProxyInterceptors.Process(IInvocation invocation, InterceptContext interceptedContext) in D:\bricks\Bricks\DynamicProxy\DynamicProxyInterceptors.cs:line 20
   at Core.Interceptors.CoreInterceptor.Intercept(IInvocation invocation) in d:\white-os\Core\Interceptors\CoreInterceptor.cs:line 29
   at Castle.DynamicProxy.AbstractInvocation.Proceed() in d:\OSS\Castle\Tools\Castle.DynamicProxy2\Castle.DynamicProxy\AbstractInvocation.cs:line 165
   at MenuBarProxy9db9f9baf7a4487db4cf235319b2ab45.MenuItem(String[] path)
   at SystemTest.EndToEnd.Corba.BasicVisualStudiotest() in C:\data\svnviews\msft_clean_30oct\ArtixAdapter\SystemTest\EndToEnd\Corba.cs:line 99
--UIItemSearchException
   at Core.UIItems.MenuItems.Menus.Find(String[] path) in d:\white-os\Core\UIItems\MenuItems\Menus.cs:line 43
   at Core.UIItems.WindowStripControls.MenuBar.MenuItem(String[] path) in d:\white-os\Core\UIItems\WindowStripControls\MenuBar.cs:line 19




Cheers,
Coordinator
Nov 9, 2008 at 11:32 AM
Can please you do a window.LogStructure() and send me the output?
Nov 10, 2008 at 10:03 AM
LogStructure() does not return anything because it is a void.
What kind of output this function does ? I have debugged my code and this function was not evaluated according
to the debugger.

Cheers

Nov 10, 2008 at 10:53 AM
LogStructure would log in a file the structure of the window.
Make sure you copy log4net.config from White source to where your executable is. I found it in "White\Core\bin\Release".

José Tavares
Nov 10, 2008 at 12:51 PM
thanks for the help.
I could not find so far the output file.
I have added log4net.config from white install into the folder of my executable(btw deven.exe).

I have checked the output file in some directory of where my tests are launched and also where i launch devenv.exe.
What is the name of the output file and where it should be generated ? 
Nov 10, 2008 at 2:19 PM
The log file should be White.log or Recorder.log. It should be in the same directory as the log4net.dll/log4net.config/Core.dll/your executable.
Are you using log4net also in your app?

José Tavares
Coordinator
Nov 10, 2008 at 8:26 PM
can you send the console output.