Page 1 of 1

Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Wed Jun 06, 2012 5:29 pm
by tallahassee101
Hi,

When I try to do a build with Ranorex 3.3 installed I get the following error:

Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task. (MSB3091)

In answer to the solutions presented: 1 - I have Microsoft Windows SDK 7.1 installed. 2 - I have Visual Studio 2005, our company cannot update to 2010 at the present time. 3 - I tried adding a registry key as specified and having the InstallationFolder value point to the v7.1 SDK location. 4 - I don't know where the "ToolPath" parameter is.

I installed Windows SDK 7.0 just as a test and received this warning instead:

The "MSBuild" task failed unexpectedly.
Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: refCount should not be less than 1.
at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
at Microsoft.Build.Collections.CopyOnWriteDictionary`2.CopyOnWriteBackingDictionary`2.get_HasNoClones()
at Microsoft.Build.Collections.CopyOnWriteDictionary`2.set_Item(K key, V value)
at Microsoft.Build.Collections.CopyOnWriteDictionary`2.System.Collections.IDictionary.set_Item(Object key, Object value)

The error goes on for a few pages. Also I don't think I should have to install an OLDER build of the windows SDK to build my project.

I also have an additional 24 new warnings similar to this one when I build:
The primary reference "Ranorex.Plugin.Flex, Version=3" could not be resolved because it has an indirect dependency on the framework assembly "UIAutomationProvider, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "Ranorex.Plugin.Flex, Version=3" or retarget your application to a framework version which contains "UIAutomationProvider, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". (MSB3268)

I started moving our team to 3.3 and now we are at a standstill because there were seems to be certain requirements that were not in 3.2.3 that are needed for 3.3. Please let me know what I need to do to move forward to 3.3. I am using Windows 7 and have all the required windows updates.

Thank you,
-Nick

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Thu Jun 07, 2012 1:15 pm
by tallahassee101
Could someone please help? This is impeding our development process for our Testing team. I'd rather not revert back as there are several new features we've been requesting in the latest build.

Thank you!

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Thu Jun 07, 2012 3:50 pm
by Support Team
tallahassee101 wrote:I also have an additional 24 new warnings similar to this one when I build:
Please, try setting the Target Framework for your projects to 3.0 or 3.5 instead of 2.0.

Regarding the "AxImp.exe" error:
Do you have any ActiveX DLLs referenced in your project?
Have you tried changing the Target Framework for that project?
As a workaround, you can manually create your interop assemblies from the ActiveX DLLs and reference the generated interop assemblies.

Could you send us your project so we can try to reproduce the problem? Thank you!

Regards,
Alex
Ranorex Team

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Thu Jun 07, 2012 4:18 pm
by tallahassee101
The target Framework was set to 2.0 in two of our projects, switching it to 3.5 fixed the 24 warnings.
However, we still have the AxImp.exe error. I dont know of any ActiveX DLLs in our project, however I'm not sure how to double check for that. Since I'm pretty sure we don't have ActiveX DLLs, I don't think your workaround applies.

Our solution and project is 400 mb, so I cannot just send it to you. Is there anything else I can try? Are we the only people seeing this issue?

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Fri Jun 08, 2012 11:06 am
by Support Team
tallahassee101 wrote:Are we the only people seeing this issue?
Apparently, yes. We have not heard of such an issue from anyone else, yet, and cannot reproduce the problem either.
tallahassee101 wrote:Our solution and project is 400 mb, so I cannot just send it to you.
Could you send just the project that fails to build, please? I guess the single project should be much smaller.

There seems to be a known issue on creating COM Interop assemblies with the .NET Framework 4.0 for some project configurations:
http://stackoverflow.com/questions/1070 ... h#10715777
However, without the project it is hard to suggest any remedies or workarounds.

Regards,
Alex
Ranorex Team

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Fri Jun 08, 2012 2:01 pm
by tallahassee101
I was able to narrow down the cause of the error. It came from the inclusion of the following libraries: IWshRuntimeLibrary and System.Runtime.InteropServices. I removed the code that relied on these libraries and found a different way to do the same thing in code. I also had to install Visual Studios 2010 on my machine at one point to get the other error AxImp.exe, which led me to the receive the MSBuild task error instead. I'm not sure if I still need VS 2010.

Thanks and Hope this helps someone else
-Nick

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Fri Jun 08, 2012 2:22 pm
by Support Team
Glad that you could find a way. We are still not sure what causes this problem and how to reproduce it. It would be great if you could provide us a sample solution to reproduce the problem with so we can try to avoid it in the future.
Thank you in advance!

Regards,
Alex
Ranorex Team

Re: Ranorex 3.3 Build error on "AxImp.exe"?

Posted: Fri Jun 08, 2012 2:35 pm
by tallahassee101
The following code was being used to run a desktop icon.

Code: Select all


using IWshRuntimeLibrary;
using System.Runtime.InteropServices;

....
public void LaunchApp(string AppName)
{	
//Get the public desktop        	
        	const int MAX_PATH = 260;
        	const int CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019;
            StringBuilder sbPath = new StringBuilder(MAX_PATH);
            SHGetFolderPath(IntPtr.Zero, CSIDL_COMMON_DESKTOPDIRECTORY, IntPtr.Zero, 0, sbPath);
            strDesktop = sbPath.ToString();
	       
            //Add the shortcut	        
	        strDesktop += "\\" + AppName + ".lnk";	        
	        
			WshShell Wshell = new WshShell();
            IWshRuntimeLibrary.IWshShortcut shortc = (IWshRuntimeLibrary.IWshShortcut)Wshell.CreateShortcut(strDesktop);
            if(shortc!=null)
            {
            	Delay.Milliseconds(5000);
            	string Target=shortc.TargetPath;
                string Arguments =shortc.Arguments;
                string WorknigDir = shortc.WorkingDirectory;
                System.Diagnostics.Process proc = new System.Diagnostics.Process();
                proc.EnableRaisingEvents=false;
                proc.StartInfo.FileName=Target;
                proc.StartInfo.Arguments = Arguments;
                proc.StartInfo.WorkingDirectory = WorknigDir;
                proc.Start();
            }
}
I now do the same thing with the following code which no longer requires the libraries that were causing the build errors:

Code: Select all

public void LaunchApp(string AppName)
{
	        string strDesktop = @"C:\Users\Public\Desktop\" + AppName + ".lnk";	  
	        Report.Info("Launch App: " + strDesktop);
	        Host.Local.RunApplication(strDesktop);
}
Of course we are now using the public desktop instead of the user specific one, but for our purposes we only needed the public desktop. Additionally if anyone is interested you can get the user specific desktop by using the "Environment" library without generating the build errors I ran into.

Hope this helps!