pouët.net

No connection string could be found in the application config file

category: code [glöplog]
 
I have an ASP.NET MVC project with Entity Framework Core 6. To this project I've recently added a unit test. When I execute this test, I get the error message:
Code:System.InvalidOperationException : No connection string named '...' could be found in the application config file.
I've already googled for this and found many pages saying that a setting is missing in the api.config file, yet I've added an api.config file to the unit test project containing
Code:<?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="..." connectionString="..."/> </connectionStrings> </configuration>
and this hasn't helped. Is the correct name of the application configuration file really app.config and where should it be placed? Does anybody have any experience with this thing?
added on the 2022-03-07 15:00:20 by Adok Adok
nope, should be called Web.config ... in the root of your project
You appear to be confused, this is not https://stackoverflow.com/
added on the 2022-03-07 16:29:15 by Rob Rob
Professional programming is all about asking questions on Stack Overflow so makes sense.
added on the 2022-03-08 13:30:34 by pestis pestis


This is comedy quality :-D
added on the 2022-03-08 18:25:52 by EvilOne EvilOne
If this thread isn't a scathing indictment of Adok's eugenics theories then I don't know what is.
added on the 2022-03-09 12:25:59 by sagacity sagacity

login