Published on: 26 June, 2014

How to use Server.MapPath in Web API C# ASP.Net?

Tumblr Digg Google Plus

As you know Server.MapPath is not available when you write code in Web API. There is an alternative way to get your site path application. You can alternatively use the following code to get the full path of your site root application.

var rootPath = System.Web.Hosting.HostingEnvironment.MapPath("~/PathGoesHere");

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.