Posts

Showing posts from September, 2017

C# - Simple Class Library and how to use it in another project

Image
C# - Simple Class Library and how to use it Create  a Class Library Project Create a new project - Console Application Right click on the newly created project and Set it as a StartUp Project Reason: You cannot run a Class Library on it’s own, it needs to be called from another project. Add a reference to your Class Library project In the SimpleClassLibrary Project - rename the Class to PrintOK and add a public method WriteOK() using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace SimpleClassLibrary { public class PrintOK {     public void WriteOK(){      Console .WriteLine( "OK" );      Console .ReadLine(); } } } Add preprocessor  directive In the UsingClassLibrary project, add the following code: using System; using...

Building your first WCF application

Image
WCF using C#: Building your first WCF application Basic Concepts The WCF system contains: Client application Service .svc (Server application) Interface  - where the clients connects usually the interface is called something like Ixyz.WCF.Project   if the project is called xyz.WCF.Project Bindings  - describe the endpoints and protocols used Proxies  - hide the serialization details from the clients Build a simple WCF app First: Create a console application New project > Console Application Name it “ProductService” but change the SolutionName to “Products” What you should get: Right click on Products (the solution) > Add > New project > Console Application > ConsoleAplication and name it ProductsClient Next, add a new project of type ClassLibrary called ProductInterfaces The result: Git repository created - files saved https://gi...