Skip to main content
I need to integrate K2 functionality into a windows forms application written in .Net 2.0.

Trying to do anything with the K2ROM causes the following exception:

"DLL 'K2ROM.dll' is attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang."

Is anyone successfully using the K2ROM from .Net 2.0? When I spoke to the regional sales rep he assured me that K2 would work correctly on .Net 2.
You also need to install .NET framework 1.1
icon-quote.gifRénier:
You also need to install .NET framework 1.1


Thanks Rénier, but the machine I'm developing on has Framework 1.1 and 2.0 installed.

The Windows Forms host application is written in VS2005 RC1 using Framework 2.0 so I can't set the framework policy to use 1.1.
yo..

have anyone of you guys managed to solved this issue? I am having the very same problem (when trying to create a process instance into K2 from C# 2005) :roll:

~ PV
I ran into the same problem. This appeared to only affect running under the debugger in VS 2005. Try Start Without Debugging and see if it still appears.

I found several references to this through Google; it is a problem with many .NET 1.1 references in 2.0 projects. The alleged solution is:

"Disable the loader lock MDA. Debug/Exceptions (ctrl-D, E), Open the Managed Debugging Assistants tree node and uncheck Loader Lock. This setting is per solution so it will only affect this solution."

I was unable to find this setting in VS 2005 for a C# project, though.
icon-quote.gifbsorensen:
I ran into the same problem. This appeared to only affect running under the debugger in VS 2005. Try Start Without Debugging and see if it still appears.

I found several references to this through Google; it is a problem with many .NET 1.1 references in 2.0 projects. The alleged solution is:

"Disable the loader lock MDA. Debug/Exceptions (ctrl-D, E), Open the Managed Debugging Assistants tree node and uncheck Loader Lock. This setting is per solution so it will only affect this solution."

I was unable to find this setting in VS 2005 for a C# project, though.


Thanx for the feedback! ..look again.. I found the setting easily and unchecked it.. and yup! this "fixes" the problem :lol:

~ PV
icon-quote.gifbsorensen:

"Disable the loader lock MDA. Debug/Exceptions (ctrl-D, E), Open the Managed Debugging Assistants tree node and uncheck Loader Lock. This setting is per solution so it will only affect this solution."


I got around this problem by using a webservice to implement all K2 calls. It also helps to make your Win Forms app work from the internet.

Thanks for the ctrl-d e, it works.
Is sourcecode working on a fix for this?

Gabor :roll:
Any place you can post your generic webservices that wrapped K2 calls?
icon-quote.gifPeter Yao:
Any place you can post your generic webservices that wrapped K2 calls?


The best I can do is to give you a short implementation C# 2.0 example:

The caller must do this to enable identity impresonation on the iis side:

dataAccessWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;


Webservice frontend:

public int K2CreateProcessInstance(string processName, List<K2DataField> K2DataFields)
{
K2Functions tempK2Functions = new K2Functions();
return tempK2Functions.K2CreateProcessInstance(processName, K2DataFields);
}


Websevice implementation in class called K2Functions
.Value = tempDataField.K2DataFieldValue;
}
}
myConnection.StartProcessInstance(tempProcessInstance);
myConnection.Close();
return tempProcessInstance.ID;
}


I hope this helps. The K2DataField class is a simple class with 2 variables for Name and Value.

Cheers,
Gabor Barla-Szabo
barlag@fourier.co.za

Reply