Skip to main content

Hi.

 

I've developed a C# application that I want to call from my K2 project. I've compiled the application as Class Library, resulting in a dll file. I referenced the dll file K2AttachmentsDecodeAndExport.dll in my K2 project Integracija. But I don't see the methods that I've written in C# in the Call a Static Method window of the Code Reference Event.

 

Any help would be appreciated.

 

 


16593iC6497E5ECF45E945.jpg

Have you tired calling your dll methods from a code/server event. If yo have referenced it in the process then I think if you start typing your namespace it should start showing up all your methods. Also check that your methods are public in the code itself.

 

 


Hi s0m3one, thanks for the reply.

 

I installed K2 for VIsual Studio and when I open the process in Visual Studio, I can see K2AttachmentsDecodeAndExport namespace and it's methods when calling a static method from the Code Reference Event. But in K2 studio, I still can't see the namespace. Not all of the clients, where we develop K2 processes, have Visual Studio, so I can't always use it to add code call to the event. Any ideas why I can see the referenced dll namespace and methods in Visual Studio but not K2 Studio?


This is strange  one, Im not sure what else to check tbh.  Code event is alo available in K2 studio, you dont need Visual Studio installed.

 

On another note, are you using call static method or call instance method. On you print screen you only get up to manage process references. On the last screen when you click finish, it should start loading you DLL methods. 


Yea, code event is available in K2 studio too, but for lets say server code event you can't write code in k2 studio, you need visual studio. But I think for a code reference event, this shouldn't be the case and I should be able to select a referenced dll method.

 

I'm calling a static method. Call an instance method is greyed out. The last screen was just to show that I have the reference, I already added it beforehand.

 

Anyone can shed some light on this, why I can't see the methods or the namespace in K2 studio? Should I open a ticket?


Thanks for confirming, I think it would be best to create a ticket on this. I have tried adding webservice and dll's as references and when i click finish it shows me a list of available method under the correct namespaces. I assume it could be omething to do witht he dll itself. Do you have any other DLL that work. Maybe do a  comparison of the two, if one of them works, if you have the code for the DLL's. 

 

@Edit: I wonder what would happen if you changed all your DLL methods to public static. Have you tried this.


I created a new Class Library in Visual Studio, added a method, and it works. Thanks for the idea to check it this way.

 

Could be a problem that I changed project Output type from Windows Application to Class Library, and things got mixed up in between.

 

I tried, and the methods need to be public static, or else K2 won't find them.

 

Thanks for all the help!


Reply