How to Add a Reference to System.ServiceModel (WCF) to an ASP.NET 5 Application

I ran into a situation yesterday wherein I needed to add a reference to System.ServiceModel to an application using DNX RC1 Final Update 1 (if it's "final", why is there an update? I digress...).

To do this, I had to add a frameworkAssemblies property to the JSON object for dnx451 declared under frameworks in my project.json file, and then add the System.ServiceModel reference there, as shown below:

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "CMS.Services.Contracts": "1.0.0-*",
        "CSharpSDK": "1.0.0-*"
      },
      "frameworkAssemblies": {
        "System.ServiceModel": "4.0.0.0"
      }
    }
  },

Comments

Popular posts from this blog

How To Mock Out Child Components In Unit Tests of Angular 2 Code

A Generic Method Using HttpClient to Make a Synchronous Get Request

The Cause and Solution for the "System.Runtime.Serialization.InvalidDataContractException: Type 'System.Threading.Tasks.Task`1[YourTypeHere]' cannot be serialized." Exception