question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrations Design: Invalid 'using' statements for default namespace

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
bricelamcommented, Nov 17, 2017

@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. 😉

0reactions
Rick-Andersoncommented, Jan 9, 2023

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

Fix the build error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Migrations' does not exist in the namespace 'Microsoft. ...
Ok, I will show you the minimal setup required for EF Core + Migrations: You will need to install Microsoft.EntityFramework.
Read more >
Managing Migrations - EF Core
You are free to move Migrations files and change their namespace manually. New migrations are created as siblings of the last migration.
Read more >
Migrations and Seed Data With Entity Framework Core
We are going to learn about Migrations and Seed data in Entity Framework Core and how to optimize EF Core migrations.
Read more >
Entity Framework Core Migrations
The migrations feature in Entity Framework Core enables you to make changes to your model ... Migrations are enabled by default in EF...
Read more >
7.2.1 Creating a Database with Code First in EF Core
The Code First approach enables you to define an entity model in code, create a database from the model, and then add data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found