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
{{ message }}
Repository navigation
2 extensions, 2 controllers with same name raise NullReferenceException #94
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.
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.
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.
Activity
DmitrySikorsky commentedon Nov 3, 2017
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.
Xarkam commentedon Jun 18, 2019
Hello @DmitrySikorsky ,
What is the state of this issue?
DmitrySikorsky commentedon Jun 24, 2019
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.