I have a solution with 2 projects, a web project and a class library.
From the web project I’m making a call to a function in the class library. This class library makes a call to sk.config file within the class library:
return HttpContext.Current.Server.MapPath("./") + "\\sk.config"; }
and it throws an error because is trying to look for it in the web project.
A solution would be to copy the sk.config file into the web project, but is there a way I can avoid copying this file twice?
Instead of copying the file, add it as a linked file – which allows any number of projects to reference the same file, in the same way as you can have many ‘shortcuts’ to the same file in Windows Explorer.
When you add an existing file to a project, there’s a dropdown arrow on the Add button which allows you to add the file to the project as a ‘link’ to the existing file.