I have a project which uses .Net Core with EF Core. I am developing this project with Visual Studio Code. Project evolves quickly and has a lot of migrations created. Each migration creates metadata file (*.Designer.cs) which is quite huge compared to migration itself. I have noticed that more migrations the project has the slower is VS Code load time and general responsiveness. My guess is that c# analyzer - Omnisharp tries to analyze *.Designer.cs files and that takes time and CPU resources. Those files are auto generated and completely useless in the perspective of code analysis. Also migration project is by far largest project in the source code.
I want to exclude migration project (or at least *.Designer.cs files) from Omnisharp analysis. Is there any way to do so?
Details:
- OS: Windows 10
- VS Code version: 1.46.1
- EF Core version: 2.2.3
- EF Core migration are in the separate project
Project structure:
- MyProject.Api
- ...
- Startup.cs
- MyProject.Api.csproj
- MyProject.DatabaseMigration
- Migrations
- 2020..01_MyMigration.cs
- 2020..01_MyMigration.Designer.cs
- MyProject.DatabaseMigration.csproj
- MyProject.RandomDomain
- ...
- MyProject.RandomDomain.csproj
- MyProject.sln
Considered solutions:
Exclude migration project in onmisharp settings. - I tried many patters but the project still loads. I have alse found open issue from which seems that this does not work (very sad) maybe someone has got this working?
Delete
.Designer.csfiles. This prevents for old migrations to be executed on new server.Delete all migration and create new single one This is the only option that I found that sort of works, but it requires to be repeated from time to time (as new migrations keeps being created) and also required manually connecting to production database and cleaning
__EFMigrationsHistorytable which is not nice.