optimajet/WorkflowServer

Problem Compiling with a reference to System.Net.Http.HttpClient

Closed this issue · 2 comments

I am attempting a Code Action for accessing data from a RESTful Api. In the Edit Code Window with the Workflow server that I downloaded today I am receiving the following error when I request a 'Compile':

2:28): error CS1069: The type name 'HttpClient' could not be found in the namespace 'System.Net.Http'.
 This type has been forwarded to assembly 'System.Net.Http, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly. 

(2:63): error CS1069: The type name 'HttpClient' could not be found in the namespace 'System.Net.Http'.
 This type has been forwarded to assembly 'System.Net.Http, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.

The source code creating this error:

 System.Net.Http.HttpClient h = new System.Net.Http.HttpClient();

It occurs this way if I use the fully qualified namespace or if I put the namespace in the usings section. Any help is appreciated!

Do you use WFS hosted in a console application or windows service?

Thank you for your comment.
We have connected the System.Net.Http library to Code actions in WFS 2.4. If you are missing some library in Code Actions, connecting it is very easy. You can create a branch from this repository and include this library in the Program.cs file.
Look at https://github.com/optimajet/WorkflowServer/blob/master/WorkflowServer/Program.cs line 59 and do the same with any other library.