Skip to main content
To debug the K2.Net in visual studio. I couldn't able to view the code part of the K2.Net 2003 Application in Visual Studio. Give some idea to debug the K2.Net 2003 in visual Studio.

And i have inserted the following codes:

I have inserted the this line in the generated code,

if system.diagnostics.debugger.IsAttached then
System.Diagnostics.Debugger.Break()
Endif

I have inserted
<Debug Enable="True"/> in the k2server.config file

And i have attached the K2.Net server exe in the visual studio.

Further step what i want to do?

Give some idea
You can not debug the code in Code Module, copy the functions in your code module to the actual events that calls then to debug from there.

I assume you restarted K2 Service after changing Debug=True.
Hi Peter Yao,
Thanks for your reply. But still now i am struggling to debug the K2.Net in visual studio.
I am having my functions in the actual events only. i compile and check the related event in the K2.net studio but it shows "Server Mail to Application(Event) compiled successfully"

But still i could'nt able to debug

Regards,
S.Agathee
I was running VS2005 debugger on the server machine that hosts K2 server.exe

You do have this in the event code?

if system.diagnostics.debugger.IsAttached then
System.Diagnostics.Debugger.Break()
Endif
Hi Peter Yao,

I am using VS2003 on the server machine that hosts K2 server.exe

And i have used this in the event code
if system.diagnostics.debugger.IsAttached then
System.Diagnostics.Debugger.Break()
Endif

Still i couldnt able to debug the K2.Net code in the VS2003.

Is there any other properties want to set in the K2.Net 2003.

Regards,

Agathee
Hi,

I have referred one K2 video file, In that after attaching the K2Server.Exe in visual studio they are setting one thing in the property window in k2.net side. Where this property window will be available. Here i have attached that property window. Give some idea about this property window.
No, that's not a property window. That is a utility called the 'Process Planner' someone wrote to easily start and interact with a process. You need a running process instance before the debugger will be attached.

-Ockert
Thanks Lot!
From where i can get this utility ('Process Planner' ).

-Agathee
Sorry, but it is an internal utility mostly used by the support consultants - not publicly available.
You don't really need it.
Surely, you've already developed your UIs for user interaction and kick-off of a process instance.
The important part is that you start a process instance and run it up to the place you've added the debug code. Only at this point, will VS.NET attach to the K2Server process and you should be able to debug.

Regards,
Ockert
Yes what you have said is correct. I have already developed UI for user interaction in VS.Net and i have created K2ROM Connection while i establishing a connection between UI and K2 Server. The below code i have used in my UI

Dim myConn As New SourceCode.K2ROM.Connection
myConn.Open("192.168.1.32", struser & "," & strpwd)

Here While establishing a connection i am facing problem
Give some idea to overcome this problem

After that i have created a process instance

Dim myProc As SourceCode.K2ROM.ProcessInstance
myProc = myConn.CreateProcessInstance("ADD_SchemesScheme_Study_Grant")

Regards,
Agathee
Please refer to the Help file for the correct format of the connection string. Specifically have a look at the 'Connection' class' Open method.
Remember - you don't have to specify a connection string. If you leave this parameter blank, the logged-on user's credentials will be passed to the K2.net Server.

HTH,
Ockert
I have referred the Help file for the format of the connection string for the open method. And i have checked once without specify a parameter(leave as blank) in the connection string. But still while establishing a connection to the K2.net server throws an exception. In the exception it shows "error:cannot obtain a value"

Regards,

S.Agathee
I left the parameter as blank in the connection string and exectue at the time i watch the K2 server there i found Error: "Index and length must refer to a location with in the string Parameter Name:Length"


Regards,

S.Agathee
Must be either a problem with your K2.net 2003 setup, your K2Studio process or your UI code. Easiest would be to run K2.net Server in console mode and step through your UI code and see what happens in K2Server when you establish the connection. Otherwise, please log a formal support call on the customer and partner portal.

Regards,
Ockert
Ok i check my UI code, K2.net 2003 setup and K2Studio process

Regards,

S.Agathee

Reply