ERROR - Non-static method requires a target QTP
When i tried to access a dll through QTP i get the following error:
Could not load file or assembly 'D:\\xyz.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I referred to one of the post and thought it could be because of .Net framework being 4.0 i changed it to 3.5 and build the solution and used the same dll then i get the following error message:
External object <NameSpace>::GetDataElementOnBedSlot has thrown the following exception:
Non-static method requires a target.
Our application is developed with .Net 4.0.
If you could give any possible solution it would be of great help.
Set oCustom = DOTNetFactory.CreateInstance("NameSpace.BedAutomat ion", "D:\\AutomationClassLibrary.dll")
oCustom.GetDataElementOnBedSlot "Unique property to identify the object", "Unique property to identify the 2nd object",BedNumber, "status"
Thanks in advance,
Re: ERROR - Non-static method requires a target QTP
You should open a ticket with HP. I believe the code looks fine but it seems some internal issues with the DotNetFacotry