<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C# on GeekyRyan</title><link>https://rnemeth90.github.io/categories/c%23/</link><description>Recent content in C# on GeekyRyan</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 12 Jun 2022 13:58:52 +0000</lastBuildDate><atom:link href="https://rnemeth90.github.io/categories/c%23/index.xml" rel="self" type="application/rss+xml"/><item><title>EF Core &amp;#8211; Unable to create an object of type DbContext</title><link>https://rnemeth90.github.io/posts/2022-06-12-ef-core-unable-to-create-an-object-of-type-dbcontext/</link><pubDate>Sun, 12 Jun 2022 13:58:52 +0000</pubDate><guid>https://rnemeth90.github.io/posts/2022-06-12-ef-core-unable-to-create-an-object-of-type-dbcontext/</guid><description>&lt;p&gt;This problem has bitten me more than once, and I can never remember how to fix it. So, why not write a blog post about it!&lt;/p&gt;
&lt;p&gt;When running EF Core migrations in a solution, you may come across this error:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://rnemeth90.github.io/wp-content/uploads/2022/06/image-1-1024x142.png" class="external-link" target="_blank" rel="noopener"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are several apparent causes. However, in my case (every time I have seen this), it has been caused by having multiple startup projects selected in Visual Studio.&lt;/p&gt;
&lt;p&gt;To fix this, simply open your Solution properties and set the startup project to ‘Current Selection’.&lt;/p&gt;</description></item></channel></rss>