I'm using Visual Basic .Net, .NET-Verion 4.6.1, VS 2019 Community.
I want to include Unittests in my project so I istalled NUnit, created a Test-Project, imported the project I want to test, call a class in the project and I get:
SetUp failed for test fixture *Project*_Test.*Class*_Test System.IO.FileNotFoundException : Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system can't find the required file.
So I searched around and installed the Config-Manager with Nuget-Console -> didn't do anything. ... copied the Config-Manager.dll from the project to my test-project -> different fileNotFound exception. This time it wants the next file.
So I debugged and saw, that the error originates on this line of code
Private ReadOnly STR_CONNECTION_STRING As String = DirectCast(New Global.System.Configuration.AppSettingsReader().GetValue("*DB_Conn_String*", GetType(String)), String)
How do I remove this error? The line of code doesn't seem to be the problem, since the test can't find the classes in the first place.
Thx for the help Daedra