Skip to main content
Hi All,

I have been experiencing the following error:

"SourceCode.K2ROM.Connection' is inaccessible due to its protection level".

The first line that failed while compiling was:

SourceCode.K2ROM.Connection WorkListConn = new SourceCode.K2ROM.Connection();

In my .NET workflow solution, I have 2 custom DLLs as shown below.

1) HE.Common.Workflow (DLL)
2) HE.BIS.Workflow (DLL)

Both projects reference:

SourceCode.K2Mng.DLL
SourceCode.K2ROM.DLL
SourceCode.KO.DLL

Without referencing SourceCode.KO.DLL, compilation is fine. However, when I reference the SourceCode.KO.DLL (even set COPY LOCAL = FALSE), I get the compilation error messages described above. So I took RĂ©nier's suggestion to remove the references from both projects, and add them back again. Sometimes (not every time, really a mistery) it seems to compile OK. But after I close and reopen the solution file and recompile it again, the same compilation error occurs.

Questions:

1) I have talked with K2 support people, it seems OK for us to reference SourceCode.KO.DLL. Is that correct?

2) The reason I need to reference SourceCode.KO.DLL is because I want to extract some data handling into my custom DLLs to maximize reusability.

For example, in one of my helper classes, I have the following method,
which will be called from K2 Studio event handlers:

class K2Helper
{
public static int GetReqId(ServerEventContext K2)
{
return Convert.ToInt32(K2.ProcessInstance.DataFieldss"ReqId"].Value);
}

...
}

Class ServerEventContext belongs to SourceCode.KO namespace, so I must reference SourceCode.KO.DLL.

Anything wrong with this approach or any suggestions?

Thanks in advance.

Michael
Be the first to reply!

Reply