Generating a REST API Client from Visual Studio 2017 and 2019

For the past year or so, I have been doing a lot of development that involves producing an OpenAPI specification document from a .NET Core based REST API and generating client code using things like AutoRestSwagger CodegenOpenAPI Codegen, and NSwag. My problem with these tools is that I often need to leave Visual Studio and quite often update the tool before I can re-generate my REST API client code. After doing this a couple of times I thought that I should just build a Visual Studio extension to make my life easier. At the end of last year I started work on a Visual Studio extension called the REST API Client Code Generator, A collection of Visual Studio custom tools for generating a strongly typed REST API Client from an Open API / Swagger specification file

With this tool I can easily switch from NSwag, AutoRest, Swagger Codegen, and OpenAPI Codegen, and re-generate my code by making changes directly to the OpenAPI specification document I have in my project.

I built Visual Studio Custom Tools for each code generator so every time I make changes to the OpenAPI specification document in my project, the client code gets automatically re-generated.

You can include an NSwag Studio file in the project and right click and re-generate my client code

And a feature that I just built today, adding a dialog for adding a new OpenAPI specification document file.

This project is open source and you get browse the repository on here and download the VSIX file from the Visual Studio Marketplace

Improve .NETCF Build Performance in Visual Studio

A lot of .NETCF developers are surprisingly not aware of the Platform Verification Task in Visual Studio. Disabling this in the build process will speed up the build of .NETCF projects. To make things quick and short, here’s what you need to do:

1) Open the file C:WINDOWSMicrosoft.NETFrameworkv3.5Microsoft.CompactFramework.Common.targets for editing.

2) Change the following:

   99   <Target
  100     Name="PlatformVerificationTask">
  101     <PlatformVerificationTask
  102       PlatformFamilyName="$(PlatformFamilyName)"
  103       PlatformID="$(PlatformID)"
  104       SourceAssembly="@(IntermediateAssembly)"
  105       ReferencePath="@(ReferencePath)"
  106       TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
  107       PlatformVersion="$(TargetFrameworkVersion)"/>
  108   </Target>

to:

   99   <Target
  100     Name="PlatformVerificationTask">
  101     <PlatformVerificationTask
  102       Condition="'$(DoPlatformVerificationTask)'=='true'"
  103       PlatformFamilyName="$(PlatformFamilyName)"
  104       PlatformID="$(PlatformID)"
  105       SourceAssembly="@(IntermediateAssembly)"
  106       ReferencePath="@(ReferencePath)"
  107       TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
  108       PlatformVersion="$(TargetFrameworkVersion)"/>
  109   </Target>

The following configuration above was an excert from an article called Platform Verification Task leading to slow builds on compact framework projects

Unit Testing for Smart Devices Webcast

On the 28th of February 2008, Microsoft Denmark will have the first and largest online launch for Windows Server 2008, SQL Server 2008, and Visual Studio 2008. We made a few webcasts related to the products and technologies to be released. Here’s one that I made entitled “Unit Testing for Smart Devices”

You can watch it from the danish MSDN community site:
http://www.msdncommunity.dk/udviklere/webcasts/smart-device-unit-testing-in-visual-studio-team-system-

or get it here:
http://blogs.commentor.dk/downloads/smart_device_unit_testing.wmv

or here:
http://cid-ca531e7fb4762c70.skydrive.live.com/self.aspx/Videos/smart%5E_device%5E_unit%5E_testing.wmv