Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Commands: --startup-project does not use locate paths correctly #5323

Closed
pranavkm opened this issue May 10, 2016 · 4 comments
Closed

CLI Commands: --startup-project does not use locate paths correctly #5323

pranavkm opened this issue May 10, 2016 · 4 comments

Comments

@pranavkm
Copy link
Contributor

--startup-project does not appear to use global.json when discovering projects. The current behavior makes it behave like --relative-path-to-startup-project which is not very user friendly.

@pranavkm
Copy link
Contributor Author

On a related note, it should be nice to have it print a graceful error rather than dumping a stack trace from the CLI.

@pranavkm
Copy link
Contributor Author

Follow up which is kinda worrying, if I do specify a relative path, I get further but the migration fails with

System.IO.FileLoadException: Could not load file or assembly 'WebApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at Microsoft.EntityFrameworkCore.DesignTimeProjectLoadContext.Load(AssemblyName assemblyName)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
   at Microsoft.EntityFrameworkCore.Tools.Cli.OperationExecutor..ctor(CommonOptions options, String startupProjectPath, String environment)
   at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.Execute(CommonOptions commonOptions, String name, String outputDir, String context, String startupProject, String environment, Action`1 reporter)
   at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)
Could not load file or assembly 'WebApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

Reproed on Win 10 and CentOS 7.1.

Running the application works fine.

@rowanmiller
Copy link
Contributor

@natemcmaster has a PR out to remove --startup-project from the CLI commands - #5312. The class library scenario isn't really supported in CLI yet, so we are going to cripple it for RC2.

@natemcmaster
Copy link
Contributor

This flag is gone now. aef38bc We'll revisit this in #5311

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants