I am trying to write some pretty basic MVC Controller code to read in a file in a direcory located in a wwwroot sub folder.
When I add this code to my controller:
String path = HttpContext.Current.Server.MapPath("~/Data/data.html");
VS tells me that HttpContext is available in "Microsoft.AspNet.Http.Abstractions": "1.0.0-beta5-11495" so using Visual Studio's quick helper I choose the option to add it to the project.json file. It also adds this using statement to my controller class.
using Microsoft.AspNet.Http;
Then all heck breaks out because while HttpContext resolves the 'Current' property does not. Furthermore, adding that package breaks the Startup.cs code because the IApplicationBuild parameter in the Configure method cannot be resolved because VS says:
The type 'IApplicationBuilder' exists in both
'Microsoft.AspNet.Http.Abstractions, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null' and
'Microsoft.AspNet.Http, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'
VS_MVCWebApp.DNX 4.5.1
Maybe I am not doing this right at all using the new dnx framework and if that is the case what is the correct approach?
At the end of the day I would like to just read in a file in my controller using 1.0.0-beta4 of he dnx451 framework.
Thanks for any help you can provide.