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:
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 containingSystem.InvalidOperationException : No connection string named '...'
could be found in the application config file.
Code:
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?<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="..." connectionString="..."/>
</connectionStrings>
</configuration>
nope, should be called Web.config ... in the root of your project
You appear to be confused, this is not https://stackoverflow.com/
Professional programming is all about asking questions on Stack Overflow so makes sense.
If this thread isn't a scathing indictment of Adok's eugenics theories then I don't know what is.