I have a class library project which has a static class to help accessing the database. I then created a test project and added an app.config file to that project, this project also references the class library project.
When I run my test it fails with:
Test method MyAppLogTest.MyAppRepositoryTest.MyAppRepositoryFindBy threw exception:
System.TypeInitializationException: The type initializer for 'MyApp.Infrastructure.Repository.DatabaseHelperFunctions' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Cannot find the path for app config file ---> System.NullReferenceException:
Object reference not set to an instance of an object.
I have tried setting the app.config to always copy to output folde but no luck, and I even appended
[DeploymentItem("MyAppTest.dll.config")]
to my test methood, and I cannot get the referenced DLL to find the file. I am an inexperienced programmer, and have no idea as to why or what I need to do, any help is greatly appreciated.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet