Skip to content

Migrations Design: Invalid 'using' statements for default namespace #2467

Closed

Description

@natemcmaster

Invalid using ; added to generated migration file because this simple project has no default namespace.

Setup https://gist.github.com/natemcmaster/90e2388c0ee1d29f440a.

Using dnx 1.0.0-beta6-12114 , EF 7.0.0-beta6-13584

dnx . ef migration add Initial

produces 20150624223653_Initial.Designer.cs which includes this at the top of the file:

using System;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using ;

The same using block appears in ModelSnapshot.cs

Activity

  1. bricelam commented on Jun 26, 2015

    @bricelam
    Contributor

    Related to #2261

  2. added this to the 7.0.0 milestone on Jun 26, 2015
  3. changed the title [-]Invalid 'using' statements generated by migration scaffolding[/-] [+]Invalid 'using' statements generated by migration scaffolding (default namespace)[/+] on Nov 5, 2015
  4. modified the milestones: Backlog, 7.0.0 on Dec 8, 2015
  5. added
    help wanted
    on Jan 13, 2017
  6. softmarshmallow commented on Jul 23, 2017

    @softmarshmallow

    this issue still occurs, and all entity under Proj.Models....

  7. Rick-Anderson commented on Aug 18, 2017

    @Rick-Anderson

    FWIW, more customers will be hitting this now that we're creating more CLI docs. See dotnet/Scaffolding#599

  8. 16 remaining items

  9. added a commit that references this issue on Nov 9, 2017
    32c336e
  10. BennyM commented on Nov 17, 2017

    @BennyM

    Awesome, I was just about to clone the repo and fix this :)

  11. bricelam commented on Nov 17, 2017

    @bricelam
    Contributor

    @BennyM I love the enthusiasm! Feel free to check out some of our other up-for-grabs issues if you're still interested in submitting a PR. 😉

  12. BlinkSun commented on Nov 28, 2017

    @BlinkSun

    oh didnt see that #2467 !!! Thank you !!!

  13. added
    good first issue
    on May 31, 2019
  14. modified the milestones: , 2.1.0 on Nov 11, 2019
  15. Ramzan-Ali12 commented on Jan 9, 2023

    @Ramzan-Ali12

    dotnet ef migrations add CreateDatabase
    when i run the above command then it will display the "Build error"

  16. Rick-Anderson commented on Jan 9, 2023

    @Rick-Anderson

    dotnet ef migrations add CreateDatabase when i run the above command then it will display the "Build error"

    Fix the build error.

  17. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuehelp wanted

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions