Skip to main content

Good day K2 People!


Using Visual Studio 2010 with the 1140 version of the K2 for Visual Studio 2010 components installed.


We referenced a Web Service by adding a Web Reference and discovering the service successfully. Before adding the reference, we changed the name from the default to “MyWebReference”. We’re using “MyWebReference” successfully inside the different server events where we need to – the intellisense picks it up as expected and all’s well. When we build the process however, we get the following error:


Error     53        The type or namespace name 'MyWebReference' could not be found (are you missing a using directive or an assembly reference?)    C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Workflow.Targets         121      6            Customer.ServiceProvider.System.Component


Please note the Framework 4 reference too. We set our project to run Framework 3.5, so this is also an unknown to us… This Web Service's target Framework is 3.5 too...


Thanks – your help is appreciated…

In Visual Studio 2010, you will need to set the target framework to 3.5 for K2 Processes.


Did you try removing the reference and re-adding it after changing the target framework. Clean the solution by deleting old dlls in the bin directory.


Thanks for the reply Sujeeth.


 


You're right, you need to change the target framework - we did do that and verified it - that's why we are baffeled by the strange .NET 4 reference.


 


I'll try to clean out the bin folder as you suggested.


OK, so it's confirmed - we did clear out everything as you suggested, and still it didn't resolve the issue... :(


I am not sure if this will work. Open the kprx file and remove all entries of "Using Customer.ServiceProvider.System.Component". Then try to build the solution. Obviously you will see different errors because the reference is removed. Try adding the web reference again from the user interface and build again. Have you rebuild the web service in 3.5 framework. note: take a backup of kprx file


Hello!


 


We managed to resolve this - but I believe this is something that needs to be looked at from a product perspective...


 


We fixed the issue by creating the proxy class in K2 for Visual Studio 2008 - we then used that proxy class in VS2010...


Thanks for sharing the solution!


Just a note: In order to host .NET 4.0 framework by K2 Host Server, you will need to add a key as follows. That way, you can compile your VS solution against 4 without changing target framework to 3.5.

1.Add the following key to the <appSettings> section of the K2HostServer.config file
<add key="netfxversion" value=" v4.0.30319" />

2.Restart K2HostServer.exe
a. You will be running in .NET 4 host, but will still execute .NET 3.5 code.
b. Although you can utilize .NET 4 based code constructs and references, you will not be able to use WF4 activities at this time.


Reply