In the solution explorer I have two separate projects , one is the main project and other is the unit test project , Now the method to be tested is in the main project ,so is the web.config
.
There is a TestMethod in the Unit test project, this method calls the in the main project , and also takes one parameter which has the web.config
location it uses that to get the value based on some key. I have tried to copy this in the app.config
in the unit test project in both cases I am getting the error
The application relative virtual path '~/UnitTestProjectAppsPortal/App.config' cannot be made absolute, because the path to the application is not known.
The method to be tested has to remain in the main project and the TestMethod in the UnitTest Project will pass the web.config
location as a parameter to it.
Now what should be done to remove this exception.