Skip to main content

Fixed: "error CS0246: The type or namespace name 'Dewiride' could not be found (are you missing a using directive or an assembly reference?)"

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

error CS0246: The type or namespace name 'Dewiride' could not be found (are you missing a using directive or an assembly reference?) The compiler ends the message with a question, and it's a good one: those are the two usual causes. The name in quotes and the line number tell you which one you have. Here are both, from the same .NET 10 project, and the fix for each.

Fixed: "MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file."

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file. I got it from a plain dotnet build, seconds after converting a solution to the new .slnx format. The conversion had worked; it had also left two solution files in one folder, and MSBuild won't guess which one you mean.

Fixed: EF Core UseCollation() Doesn't Change the MySQL Column Collation with Oracle's MySql.EntityFrameworkCore

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

I gave a column a case-sensitive collation with EF Core's UseCollation("utf8mb4_0900_as_cs"), created the migration, applied it, and dotnet ef printed Done. The column was still utf8mb4_0900_ai_ci, and MySQL still refused desks as a duplicate of Desks. Oracle's MySQL provider for EF Core leaves UseCollation out of the SQL it generates. Here's how I found that, what Oracle documents instead, and the migration that does change the column.

Fixed: "Failure processing application bundle. DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write cache directory couldn't be created."

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

I built an EF Core migrations bundle, ran it, and got three lines instead of migrations: Failure processing application bundle. Failed to determine location for extracting embedded files. DOTNET_BUNDLE_EXTRACT_BASE_DIR is not set, and a read-write cache directory couldn't be created. The bundle was fine. The folder it extracts into, ~/.net, had belonged to root since 2023.

Fixed: "The migration '…_MakeDescriptionRequired' has already been applied to the database. Revert it and try again." in EF Core

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

The migration '20261103044430_MakeDescriptionRequired' has already been applied to the database. Revert it and try again. If the migration has been applied to other databases, consider reverting its changes using a new migration instead. dotnet ef migrations remove checks the database before it deletes anything, and this migration was in it. The message holds both fixes: one for your own development database, one for every other database.

Fixed: "Your target project 'Dewiride.Inventory.Api' doesn't match your migrations assembly 'Dewiride.Inventory.Data'" in EF Core

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Your target project 'Dewiride.Inventory.Api' doesn't match your migrations assembly 'Dewiride.Inventory.Data'. Either change your target project or change your migrations assembly. dotnet ef built the solution, then refused to write the migration, because it would have put the files in a project where EF Core would never look for them. The message offers two fixes; one of them moves your migrations to the web project, and it's usually not the one you want.

Fixed: "Your startup project 'Dewiride.Inventory.Data' doesn't reference Microsoft.EntityFrameworkCore.Design" in dotnet ef

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Your startup project 'Dewiride.Inventory.Data' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again. The message offers two fixes, in one sentence. In a solution where the DbContext lives in a class library, the first one is usually right: the tools were using the wrong startup project.

Fixed: "No project was found. Change the current working directory or use the --project option." in dotnet ef

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

No project was found. Change the current working directory or use the --project option. This is often the first thing dotnet ef prints in a solution with more than one project. It doesn't even build: the folder you're in has no project file for it to use. Here's why, how to see which projects you have, and the command that works.

Fixed: "error CS8618: Non-nullable property 'Description' must contain a non-null value when exiting constructor" in C#

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

error CS8618: Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable. The compiler is telling you that a property you declared as never-null can be null the moment an object is created. The message names two fixes; there are five, and they mean different things. Here's each one, built for real on an EF Core entity, and how to choose.

Fixed: "The association between entity types 'Category' and 'Product' has been severed, but the relationship is either marked as required" in EF Core

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

Deleting a category through EF Core worked as designed until the request loaded the category's products first. Then the delete failed with System.InvalidOperationException: The association between entity types 'Category' and 'Product' has been severed, but the relationship is either marked as required or is implicitly required because the foreign key is not nullable. It came from Remove(), before any SQL ran, so the error handling around SaveChangesAsync never saw it.