Skip to main content

Hi,

We have our own Data Access Layer (DAL) .NET Dlls that allows us to access our SQL databases.  I added a Server Event that supposed to read/write to our custom DB through our DAL, added the reference, but I keep getting this error:

Could not load type 'Foo.BusinessEntities.StatusType' from
assembly 'Foo.BusinessEntities, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.
 
The deployment of the workflow succeeds.  On the server, the log shows a similarly worded message:
 
"1285816","2008-09-05 04:20:16","Debug","General","15","GeneralDebugMessage","SourceCode.KO.ProcessInstance.HandleException","15 ServerEvent: Could not load type 'Foo.BusinessEntities.StatusType' from assembly 'Foo.BusinessEntities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.","","","K2BP01DV:d:k2 blackpearlHost ServerBin","1285816","d9603e7e067c4c19bdf078f6b029483e",""
 
 And in the folder on the server, I can see that the DLL is there in the folder:
 
D:K2 blackpearlHost ServerBinWorkProc97
 Does anybody have any experience with using 3rd party DLL or even your own custom DLLs and accessing SQL servers?
 
Thanks,
 
Roy
 
 

 

 

 

I have invoked custom assembly methods from server code events many times.  If you take the same code that you put into the server code event and try running it in simple console app, what happens?


Good call.  I just tried that and my configuration file is messed up.  The fault is on my end.

 Thanks for the reminder!


Hi,

So I fixed up my configuration file and I can get it to work from a standalone app.  The problem now is that when I deploy the workflow, the app.config file that is part of my Extender project is not being deployed.  Is there a way to make it deploy?  Also, I tried copying it over manually, but it can't seem to read it. 

 Does anybody have any idea how to read custom app.config files in Extender projects in K2 Blackpearl SP1?


I don't know how to do that, but I do have another alternative.  Instead of a config file, you could use K2 Environment Variables (string table) to hold your configuration information.  That way, when you move it out of dev to the next environment, you can easily set the configuration values for the new environment and have them deployed by blackpearl.

Hi,

I finally got it working.  The problem was that we used the Reference mechanism underneath the Extender Project that Visual Studio has built in.  We had to add every DLL using the K2 Reference manager.  However, after checking things in some weird stuff happened and it lost track of a couple of references.  So we had to remove them and re-add them.  Also, in Visual Studio, adding a reference to let’s say x.dll that relies on y.dll and z.dll – VS will bring in y and z.  In the Reference Manger, that doesn’t happen.

All in all there’s still some weirdness where it doesn’t like holding on to the references.  I don’t know why, but it happens usually after checking in files (and the files becoming read-only).

 The "References" in the Extender project is apparently deprecated, and using it will not add the DLL references correctly in your Extender project.

 Hope that helps people out there.


Reply