Error in migrations in EFCore

2019-07-31 10:29发布

问题:

When I run Add-Migration using Microsoft.EntityFrameworkCore.Tools 1.1.1, I get the following error:

Add-Migration : Exception calling "Substring" with "1" argument(s): "StartIndex cannot be less than zero. Parameter name: startIndex" At line:1 char:1 + Add-Migration + ~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-Migration], MethodInvocationException + FullyQualifiedErrorId : ArgumentOutOfRangeException,Add-Migration

The same stuff works perfect with version 1.1.0-preview4-final

回答1:

This is issue #8163. You can safely ignore the error. It will be fixed in 2.0.0-preview2-final.