Skip to main content
Nintex Community Menu Bar

in k2; Referencing a dll that depends on a config file to operate properly

  • September 9, 2009
  • 8 replies
  • 27 views

Forum|alt.badge.img+11

Hi


This is extremely important;  the case is as follows:


1. Design a work flow that contains at least two activities each has a default client event and a default server event (code).


2. On the k2 canvas add a reference to a dll that depends on a config file to operate - the config file may contain connection string to some database -.


3. Build and deploy the workflow then create and instance of the process.


the following error appears


"Unable to find assemly 'BLA.BLA.BLA, version 1.0.0.0, Culture=neutral,PublicKeyToken=xxxxxxxxxxx'."


 


 

8 replies

Forum|alt.badge.img+11
  • Author
  • September 9, 2009
I am using a wcf class that requres a .config file

Forum|alt.badge.img+11
  • Author
  • September 9, 2009

In my urge to solve the problem i did the following: 


I placed the required config file in all the Possible directories k2 could use.


I also placed the dll in the GAC.


 


but still it didnt work


Forum|alt.badge.img+4
  • September 9, 2009

You have put the config file somewhere on the server and load the file in your code. I don't remember exectly how, but something ala ConfigurationManager.Load(filename) or similar.

Google is your friend. :-)


Forum|alt.badge.img+11
  • Author
  • September 9, 2009

You mean i do the following


place the following code in the dll constructor.


{


System.Configuration.ConfigurationFileMap fileMap = new ConfigurationFileMap(strConfigPath); //Path to your config file
System.Configuration.Configuration configuration = System.Configuration.ConfigurationManager.OpenMappedMachineConfiguration(fileMap);


}


 


can you be more specific regarding the config file location on the server


Forum|alt.badge.img+4
  • September 9, 2009

Somewhere = anywhere where it can be accessed by your process - including read right by the K2 service account.

 If you had read the code you pasted in your post, you would see that the path is stored in strConfigPath...


Forum|alt.badge.img+11
  • Author
  • September 13, 2009
Thanks for the reply; it seems that you misunderstood my discussion about the path. what i meant was the K2HostServer.config which can be updated to hold the configurations needed.

Forum|alt.badge.img+4
  • September 13, 2009
No, you don't store your config in that file. Just make a new config file for your application and store the file somewhere (anywhere) on the harddrive.

Forum|alt.badge.img+11
  • Author
  • September 14, 2009

Thanks cato


just visit the following site to understand what i mean about the k2hostserver.config


and read the first paragraph


http://www.k2thought.com


Thanks again for your help.