In my .net solution I have a EF migration project. If I run this project from within Visual Studio (in debug or in release mode), it always executes successfully and it recreates my database just fine.
However if I use the following command from a command prompt or powershell (with administrator privileges):
dotnet run -c Release -- database --environment local
this consistently leads to the following error during compilation:
C:Program Filesdotnetsdk8.0.204RoslynMicrosoft.CSharp.Core.targets(84,5): error : Fatal error. System.AccessViola tionException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
This command used to execute just fine up until a couple of weeks ago. Note that this only occur on my main desktop machine. If I run it on my laptop or on my colleagues’ desktop, it runs just fine.
The solution is pretty big with tons of projects inside and they all run just fine. I also have games and photo editing software running on my computer so I think its quite safe to exclude a hardware issue.
The .net version is the same on my deskop and laptop too (8.0.204)
What could I do to solve this ?