Blog: 2016 October

.NET Core: Missing mscorlib after installing a Portable Class Library (PCL) or .NET Standard library

October 3, 2016, (updated on October 4, 2016), Software Development

.NET Core projects can reference Portable Class Libraries if one of the .NET Standard compliant profiles is used (e.g. the profile 259). However, after installing a PCL NuGet package in a .NET Core projects, you may end up with the following compiler error: The type '???' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. To fix this, just install the following PCL compatibility NuGet in your project: Microsoft.NETCore.Portable.Compatibility The package provides bindings for the missing “mscorlib” so that the project can be compiled without problems. Read more...

Tags: , , ,

NSwag Tutorial: Generate an Angular 2 TypeScript client from an existing ASP.NET Web API web assembly

October 1, 2016, (updated on October 7, 2016), 6 comments, Software Development

This tutorial shows how to automatically generate an Angular 2 TypeScript client with the NSwag Swagger toolchain. You can use this client in your Angular 2 SPA (single-page application) to consume the web services of an existing Web API project. The metadata for the client generator will be loaded from an existing .NET assembly which contains your Web API controller classes. The NSwag project provides many other TypeScript templates (for targeting other JS frameworks) and also a C# client generator. For ASP.NET Core projects, I recommend to use the middleware to generate the Swagger spec (there are some problems loading […] Read more...

Tags: , , , , ,


  Page 1 of 1