Question

Unable to add external .dll in OpenSpan toolbox

I am trying to add an external .dll into my automation project. For my learning I created a .dll (GetName) from a class library project and I am trying to add that in OpenSpan toolbox

Following are the steps that I followed:

1) I created a C# class library project with one public method name GetName(string firstName, string lastName) that returns string as "Full name is firstName + lastName"

I made sure that the class library project is also built on .NET Framework 4.6.1, the same framework in which i am building automation. Code is as attached

2) I build the class library project. Copied the .dll from bin\Debug folder and pasted it to C:\Program Files (x86)\OpenSpan\OpenSpan Plug-in for Microsoft Visual Studio 2015.

3) In my automation project I added a reference by referring to the .NET Component and selected GetName.dll

4) In my openspan project in Toolbox, I added the .dll reference by browsing the .dll

Now I am unable to view the .dll name or corresponding methods in Toolbox.

Please let me know what step I am missing to add this simple custom .dll in my OpenSpan toolbox.

Following is the code for GetName.dll for which I created a class library project with name GetName123

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GetName123
{
public class GetName
{
public GetName()
{ }
public string GetFullName(string firstName, string lastName)
{
return "My full name is " + firstName + " " + lastName;
}
}

}

Any help would be appreciated. Please let me know what need to be done so that I can view this custom dll i.e. GetName in my OpenSpan toolbox.

Let me know if you need any additional information from my end.

Thanks & Regards,

Randy

Correct Answer
April 9, 2019 - 12:05am

Create component project instead of class library and follow the same steps as you explained.

OR

Make class and methods as static members in class library. (didn't try)

Comments

Keep up to date on this post and subscribe to comments

April 8, 2019 - 3:55pm

I would like to add that I was able to successfully add this custom .dll in another Windows Application project and was able to add this custom .dll as reference. Thereafter creating an instance of this imported .dll I was able to use the public functions.

But somehow in my OpenSpan project when I add reference of this .dll and try to add in toolbox it doesn't show up. Nor does it gave any error

April 9, 2019 - 12:05am

Create component project instead of class library and follow the same steps as you explained.

OR

Make class and methods as static members in class library. (didn't try)

December 1, 2019 - 8:55am

how to create component project ?

December 2, 2019 - 1:18am
Response to mohamedb8634

In visual studio->new project->class library. Once project loaded, delete the default class1. Now, right click on project and click on add->component. Write required methods and build the solution. Follow below instructions to use in automation.

https://community1.pega.com/community/pega-support/question/how-add-any-custom-net-component-robotics-solution

December 2, 2019 - 1:25am
Response to Jayachandra Reddy K

Thank you !