Jump to content

Resolution of the dependency failed.


Recommended Posts

Hello,

We are using AutoIt for doing windows automation testing of WPF and Windows application.

Run("C:\Program Files (x86)\ABC\XXX2016\XXX.exe")

When we are executing above line and it will throw the following error:



 
Quote

 


Session Summary Information:
Date/Time: 4/26/2018 11:00:54 AM
ApplicationVersion: 16.6.6319.24264
CommandLine: "C:\Program Files (x86)\ABC\XXX2016\XXX.exe" 
CurrentCultureName: en-US
CurrentUICultureName: en-US
DnsDomainName: 
Duration: 00:00:04.8131492
HostName: ilink055
MemoryMB: 3752
OSArchitecture: Amd64
OSCultureName: en-US
OSFullNameWithServicePack: Windows 10 Professional
OSVersion: 10.0.14393
ProcessorCores: 4
OSVersion: 10.0.14393
RuntimeVersion: 4.0.30319.42000
OSVersion: 10.0.14393
TerminalServer: False
Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Sfs.Core.Preferences.PreferenceRepository", name = "(none)".
Exception occurred while: while resolving.
Exception is: CompositionException - The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) No exports were found that match the constraint: 
	ContractName	Sfs.Core.Preferences.IIsPreferenceEnabledValidator
	RequiredTypeIdentity	Sfs.Core.Preferences.IIsPreferenceEnabledValidator

Resulting in: Cannot set import 'Sfs.Core.Preferences.PreferenceRepository.PreferenceEnabledValidator (ContractName="Sfs.Core.Preferences.IIsPreferenceEnabledValidator")' on part 'Sfs.Core.Preferences.PreferenceRepository'.
Element: Sfs.Core.Preferences.PreferenceRepository.PreferenceEnabledValidator (ContractName="Sfs.Core.Preferences.IIsPreferenceEnabledValidator") -->  Sfs.Core.Preferences.PreferenceRepository

-----------------------------------------------
At the time of the exception, the container was:

  Resolving Sfs.Core.Preferences.PreferenceRepository,(none)
 ---> System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) No exports were found that match the constraint: 
	ContractName	Sfs.Core.Preferences.IIsPreferenceEnabledValidator
	RequiredTypeIdentity	Sfs.Core.Preferences.IIsPreferenceEnabledValidator

Resulting in: Cannot set import 'Sfs.Core.Preferences.PreferenceRepository.PreferenceEnabledValidator (ContractName="Sfs.Core.Preferences.IIsPreferenceEnabledValidator")' on part 'Sfs.Core.Preferences.PreferenceRepository'.
Element: Sfs.Core.Preferences.PreferenceRepository.PreferenceEnabledValidator (ContractName="Sfs.Core.Preferences.IIsPreferenceEnabledValidator") -->  Sfs.Core.Preferences.PreferenceRepository

   at System.ComponentModel.Composition.CompositionResult.ThrowOnErrors(AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)
   at MefContrib.Integration.Unity.Strategies.ComposeStrategy.PostBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
   at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
   at Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[T](IUnityContainer container, ResolverOverride[] overrides)
   at Sfs.Max.Shell.Bootstrapper.ConfigureServiceLocator()
   at Microsoft.Practices.Prism.UnityExtensions.UnityBootstrapper.Run(Boolean runWithDefaultConfiguration)
   at Sfs.Max.Shell.App.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


 

 

But when we execute this executable file manually by doing double click it is running properly.

So what we can do in this case?

Thanks in Advance :)

 

Link to comment
Share on other sites

  • Developers

Does it need to be ran in x64 or x86 mode and how are you running it currently?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

So try running the script with the x64 version of autoit3:

When using the Full version of SciTE4AutoIt3  just use the directive:

#AutoIt3Wrapper_UseX64=Y

or else use the autoit3_x64.exe to run the script manually.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Try adding the Workdir parameter to the Run() command, setting it to the program path. 
Please show me the SciTE ouput pane information when running the script so I can verify some things.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hello Jos,

"Try adding the Workdir parameter to the Run() command, setting it to the program path. "

I don't know what you are tryiny to say from above line. do you have any example ?

 

SciTE output Pane information:

Quote

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Ronak.Pandya\AutoIt\TestApp.au3" /UserParams    
+>16:53:13 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\ronak.pandya\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\ronak.pandya\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Ronak.Pandya\AutoIt\TestApp.au3
+>16:53:13 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Ronak.Pandya\AutoIt\TestApp.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
+>16:53:13 AutoIt3.exe ended.rc:0
+>16:53:13 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.92

 

Link to comment
Share on other sites

  • Moderators

In this instance, the help file is your friend. As Jos explained above, try setting the WorkingDir parameter on the run command to the directory where your EXE lives. See below the syntax of Run:

Run("program", "WorkingDir", show_flag, opt_flag)

So, instead of just Run("EXE Path") you would do this:

Run("EXE Path", "EXE Directory")

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hello JLogan3o13,

 

Thanks for your support it works :)

But when i am trying to get window by its title its giving following error:

Quote

WinWaitActive("<<TITLE>>")

Error::

Name = 'application.Name' threw an exception of type 'System.InvalidOperationException'

Can you please check this ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...