How to find out where my error came from?

I have an annoying error that appears, and I don't know where it comes from. Mistake:

Error 31 Unable to copy file "app.config" to "bin\Debug\Framework.Tests.dll.config". Could not find file 'app.config'. Framework.Tests 

The problem is that I don't have the bin \ Debug folder anywhere, and it doesn't say where it is trying to copy app.config from. Double-clicking by mistake does not lead me to the entire code where it is trying to copy, so this does not help either. Therefore, I do not know where app.config should be.

How can I find out?

+7
source share
3 answers

You added a link to a file called app.config or Visual Studio did it for you. The file does not exist on disk, apparently because after adding the link you later deleted the file.

Find the missing file in Solution Explorer and delete the link or create the file.

Most likely, this is in the root folder of one of your projects and should have a yellow warning triangle icon indicating that the file is missing.

enter image description here

+17
source

In the MSTest project, app.config is the one you want to provide to any calls to the ConfigurationManager class.

It is at the root of your test project.

The bin \ debug folders will be created after compiling the project for the first time. Listing all the files in the solution explorer should help, because they are not (and should not) be included in the project.

NTN

0
source

You probably have the bin \ Debug folder under the project folder, which is the source folder of the assembly created by Visual Studio when creating the project for Debug configuration.

My guess is that something (possibly a test environment) still has a loaded DLL file, so Visual Studio cannot delete and replace the existing Framework.Tests.dll.config file with the contents of your app.config. [Note: the action of building the project for the app.config files is to copy it to the target folder, renamed according to the executable file, with the extension .config.]

0
source

All Articles