Base solution for your next web application
Open Closed

ContextModelSnapshot Modified on Add Migration #3250


User avatar
0
jdavis01 created

I have this really annoying issue on schema modification and add-migration..

Using Visual Studio 2017 15.2.26430.6 and AspNetZero Template AspNet.Core MVC & JQuery on Framework 4.6.1

Everytime I update the schema, add migration the update-database command will not execute because the build fails.

The error code is CS1001 Identifier expected and it is coming from a blank using statement (using;) in both the PROJECTAMEDbcontextModelSnapshot.cs file and the migration file just created from the add-migration command.

If I modify these files to remove the "using;" statements and save the build is just fine until I modify the schema again and add a migration..

Not sure if you have seen this or not but it is rather an annoying issue and would love to see if you have some feedback on it ..


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @jdavis01,

    I haven't faced this before. Do you use any tool on VS like resharper ?

    Thanks.

  • User Avatar
    0
    jdavis01 created

    No I havent installed resharper on my vs 2017 installation yet. The only extensions i am using at the moment are the ones recommended in the Pre Requisites seciton of the development guide here [https://aspnetzero.com/Documents/Development-Guide-Core#pre-requirements])

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like this is related to <a class="postlink" href="https://github.com/aspnet/EntityFramework/issues/2467">https://github.com/aspnet/EntityFramework/issues/2467</a>. But I couldn't understand why we didn't face this. Anyway, you can follow this issue. When it is fixed your problem might be fixed as well.

    Thanks.