Skip to content

Commands silently swallow exceptions from Startup.cs #2553

Closed as not planned
Closed as not planned

Description

@rytmis

We use startup.cs in a class library to configure connection strings for running migrations and other commands that are common to multiple projects.

Now, if the Startup ctor or one of the configuration methods throws an exception, ContextTool.TryCreateContextFromStartup silently swallows it without a trace. This makes it rather difficult to understand why our connection strings aren't being found. :)

Activity

  1. rytmis commented on Jul 7, 2015

    @rytmis
    Author

    Minimal repro steps

    1. Create a new web project with a Startup.cs
    2. Create a new EF DbContext
    3. add "throw new Exception();" to the ctor of Startup.cs
    4. run dnx . ef migration add empty --context YourContextName

    Expected result

    Exception details printed to the console

    Actual result

    No trace of the exception

  2. bricelam commented on Jul 7, 2015

    @bricelam
    Contributor

    Yeah, we should at least show them as warnings before falling back to other ways of constructing DbContext classes.

    This is part of the higher-level issue #639.

  3. added this to the 7.0.0 milestone on Jul 7, 2015
  4. modified the milestones: , 7.0.0 on Sep 17, 2015
  5. bricelam commented on Sep 23, 2015

    @bricelam
    Contributor

    Closing since this work is tracked by #2294

  6. removed this from the milestone on Sep 24, 2015
  7. removed their assignment
    on Sep 24, 2015
  8. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions