Two output file names resolved to the same output

后端 未结 21 906
攒了一身酷
攒了一身酷 2020-12-13 23:50

Recently I created new Form called WorkersScreen. When I try to run the project I got this error:

Error 1 Two output file nam

21条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 00:05

    Normally, if you create a migration like this

    Add-Migration "UpdateProducts"
    

    Visual Studio will create a migration with a class name like UpdateProducts. If you add a new migration later using the same migration name, it will generate a migration with a class name like UpdateProducts1., automatically adding an incremented digit to the end as a suffix. Every time you generate a new migration, the number goes up by one.

    In our case, for some reason, VS got confused, and started generating subsequent migrations with the same class name as existing migration, so that that there were two auto generated migrations with the same name.

    Simply changing the class name of the new migration clears the problem.

提交回复
热议问题