optimajet / WorkflowServer

Workflow Server is a ready-to-use Workflow Engine-based application that you can deploy into your infrastructure. It can be integrated with NodeJS, PHP, Ruby, .NET, or Java applications via a REST API. Workflow Server is a key component for managing the lifecycle of business objects within your enterprise.
https://workflowserver.io
191 stars 54 forks source link

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

Closed swageblock closed 5 years ago

swageblock commented 5 years ago

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!

betine commented 5 years ago

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

optimajet commented 5 years ago

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.