Skip to content

2 extensions, 2 controllers with same name raise NullReferenceException #94

Open

Description

@dhtek

Hello,

I created 2 extensions. Each one has a controller named "HomeController" with their views (Views/Home/Index.cshtml).
When I browse to the first loaded extension => it's working great.
When I browse to the second loaded extensions => NullReferenceException: Object reference not set to an instance of an object (AspNetCore._Views_Home_Index_cshtml+d__0.MoveNext() in Index.cshtml)

If I rename the second controller and the view folder in the second extension to match the controller, it's working.
If I remove the first extension from the extensions folder, it's also working.

I don't know if we should use a new ModuleViewLocationExpander for Razor to load correctly the views.

Thanks

Activity

  1. DmitrySikorsky commented on Nov 3, 2017

    @DmitrySikorsky
    Member

    Hm, thank you for this report. I need to test and to think why do we have null reference and what is the best way to allow controllers with the same names.

  2. Xarkam commented on Jun 18, 2019

    @Xarkam
    Contributor

    Hello @DmitrySikorsky ,

    What is the state of this issue?

  3. DmitrySikorsky commented on Jun 24, 2019

    @DmitrySikorsky
    Member

    Hello @Xarkam. I think you will have the same result if just add 2 controllers with the same names into the 2 projects and then add dependencies on them to you web app, because it is really not possible by default to have 2 controllers with the same names. I'm not sure about null reference, need to investigate. Please help if have time, thanks.

  4. added this to the 5.0.0 milestone on Aug 8, 2019
  5. modified the milestones: 5.0.0, 6.0.0 on Nov 16, 2019
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions