I finally found out. I have a website project and my API in my solution. The problem was that the website was set as startup project. So that entity framework searched the connection string in the website’s web.config
and not in the api’s web.config
. Changing the startup project to my API solved the problem.
If you want to have the website project as startup project. Just copy the connection string into the websides web.config
.
Nevertheless thanks for everyones help.
Related Contents:
- EF migration for changing data type of columns
- There is already an open DataReader associated with this Command which must be closed first
- MetadataException: Unable to load the specified metadata resource
- How to get the connection String from a database
- What is the purpose of the “Prefer 32-bit” setting in Visual Studio and how does it actually work?
- The cast to value type ‘Int32’ failed because the materialized value is null
- What is the difference between Debug and Release in Visual Studio?
- Entity Framework async operation takes ten times as long to complete
- What is the purpose of the vshost.exe file?
- Why is “Set as Startup” option stored in the suo file and not the sln file?
- Pass connection string to code-first DbContext
- Add Items to Columns in a WPF ListView
- The type of one of the expressions in the join clause is incorrect in Entity Framework
- Debugging automatic properties
- .NET Core 2.2 Can’t be Selected In Visual Studio Build Framework
- Is it possible to capture a 0..1 to 0..1 relationship in Entity Framework?
- A specified Include path is not valid. The EntityType does not declare a navigation property with the name *
- Does Entity Framework Code First support stored procedures?
- Why is inserting entities in EF 4.1 so slow compared to ObjectContext?
- Entity Framework Code Only error: the model backing the context has changed since the database was created
- An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key
- Insert data using Entity Framework model
- Why does Visual Studio Type a Newly Minted Array as Nullable?
- How can I embed an application manifest into an application using VS2008?
- Entity Framework 6: audit/track changes
- How to Bulk Update records in Entity Framework?
- Determine assembly version during a post-build event
- linq to entities doesn’t recognize a method
- Self referencing loop detected – Getting back data from WebApi to the browser
- Entity Framework Filter “Expression”
- Dynamic MySQL database connection for Entity Framework 6
- How to declare one to one relationship using Entity Framework 4 Code First (POCO)
- DbSet.Attach(entity) vs DbContext.Entry(entity).State = EntityState.Modified
- ‘No database provider has been configured for this DbContext’ on SignInManager.PasswordSignInAsync
- How does Entity Framework work with recursive hierarchies? Include() seems not to work with it
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- Mapping Database Views to EF 5.0 Code First w/Migrations
- Unable to copy a file from obj\Debug to bin\Debug
- Generate C# project using CMake
- Include with FromSqlRaw and stored procedure in EF Core 3.1
- Is Deferred Execution in Asp.net MVC View a very bad thing?
- Eager , Lazy and explicit loading in EF6
- Why is Asp.Net Identity IdentityDbContext a Black-Box?
- Can EF automatically delete data that is orphaned, where the parent is not deleted?
- c# Visual Studio …adding references programmatically
- Should I compile release builds with debug info as “full” or “pdb-only”?
- The name ‘ViewBag’ does not exist in the current context – Visual Studio 2015
- How to do an “in” query in entity framework?
- Why Entity Framework performs faster than Dapper in direct select statement [closed]
- How to Specify Primary Key Name in EF-Code-First