I have the following method code:
private Image GetMapIcon()
{
//TODO Fix path
return Image.FromFile("D:\\Work\\FindandCompare\\Main\\NHSChoices.FindAndCompare.Web\\Content\\img\\mapIcon.png");
}
As you can see the path will only work on my machine. I tried all sorts to get it to work without being so specific, but I couldn't! For example:
private Image GetMapIcon()
{
//TODO Fix path
return Image.FromFile(Url.Content("~/Content/img/mapIcon.png"));
}
The method is sitting within an MVC Controller.
I do not want to add a whole new Class Library project to the VS Solution to hold a resource. Is there an easier way that will work once this is deployed to the server?