Saturday, October 25, 2014

Microsoft OWIN: Getting base path for web services (C#)

In my recent post on using OWIN and WebApi, I described how to separate your controllers into a separate DLL. Often the controllers need to call other methods that may need access to the base path of the web service (e.g. the bin folder).

The code below can be used to find that base path from other classes, without having to always pass a path parameter from method to method.

No comments:

Can't RDP? How to enable / disable virtual machine firewall for Azure VM

Oh no!  I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore.  I did ...