You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a DAL project to hold EntityFramework stuff.
When run dnx . ef migration add changecolumn under DAL project, result will be:
Using context 'ApplicationDbContext'.
System.InvalidOperationException: A type named 'StartupProduction' or 'Startup' could not be found in assembly
'Itemz.DAL'.
在 Microsoft.AspNet.Hosting.Startup.StartupLoader.FindStartupType(String startupAssemblyName, IList`1 diagno
sticMessages)
在 Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureStartup()
在 Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureApplicationServices()
在 Microsoft.AspNet.Hosting.Internal.HostingEngine.get_ApplicationServices()
在 Microsoft.Data.Entity.Commands.ContextTool.TryCreateContextFromStartup(Type type, String startupAssemblyN
ame)
在 Microsoft.Data.Entity.Commands.ContextTool.CreateContext(Type type, String startupAssemblyName)
在 Microsoft.Data.Entity.Commands.MigrationTool.CreateContext(Type type, String startupAssemblyName)
在 Microsoft.Data.Entity.Commands.MigrationTool.AddMigration(String migrationName, String contextTypeName, S
tring startupAssemblyName, String rootNamespace, String projectDir)
在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass11_0.<AddMigration>b__0()
在 Microsoft.Data.Entity.Commands.Program.Execute(String startupProject, Func`1 invoke)
在 Microsoft.Data.Entity.Commands.Program.AddMigration(String name, String context, String startupProject)
在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass9_1.<Main>b__6()
在 Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args)
在 Microsoft.Data.Entity.Commands.Program.Main(String[] args)
.....
If run dnx . ef migration add changecolumn command under Web project which referenced DAL project, the result will be:
···
System.InvalidOperationException: No DbContext was found. Ensure that you're using the correct assembly and tha
t the type is neither abstract nor generic.
在 Microsoft.Data.Entity.Commands.ContextTool.SelectType(IEnumerable1 types, String name) 在 Microsoft.Data.Entity.Commands.MigrationTool.GetContextType(String name) 在 Microsoft.Data.Entity.Commands.MigrationTool.AddMigration(String migrationName, String contextTypeName, S tring startupAssemblyName, String rootNamespace, String projectDir) 在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass11_0.<AddMigration>b__0() 在 Microsoft.Data.Entity.Commands.Program.Execute(String startupProject, Func1 invoke)
在 Microsoft.Data.Entity.Commands.Program.AddMigration(String name, String context, String startupProject)
在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass9_1.
I have a DAL project to hold EntityFramework stuff.
When run
dnx . ef migration add changecolumn
under DAL project, result will be:If run
b__6()dnx . ef migration add changecolumn
command under Web project which referenced DAL project, the result will be:···
System.InvalidOperationException: No DbContext was found. Ensure that you're using the correct assembly and tha
t the type is neither abstract nor generic.
在 Microsoft.Data.Entity.Commands.ContextTool.SelectType(IEnumerable
1 types, String name) 在 Microsoft.Data.Entity.Commands.MigrationTool.GetContextType(String name) 在 Microsoft.Data.Entity.Commands.MigrationTool.AddMigration(String migrationName, String contextTypeName, S tring startupAssemblyName, String rootNamespace, String projectDir) 在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass11_0.<AddMigration>b__0() 在 Microsoft.Data.Entity.Commands.Program.Execute(String startupProject, Func
1 invoke)在 Microsoft.Data.Entity.Commands.Program.AddMigration(String name, String context, String startupProject)
在 Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass9_1.
在 Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args)
在 Microsoft.Data.Entity.Commands.Program.Main(String[] args)
···
The text was updated successfully, but these errors were encountered: