Let me explain you it again,
I have created two plugins. 1. CustomPlugin 2. MyPlugin
I use _productBox.cshtml view page in both plugin.
Now, I have used View Engine in both plugin like:
-->For CustomPlugin
PartialViewLocationFormats =
new[]
{ //themes
"~/Themes/{2}/Views/{1}/{0}.cshtml",
"~/Plugins/CustomPlugin/Views/{1}/{0}.cshtml"
};
--> MyPlugin
PartialViewLocationFormats =
new[]
{ //themes
"~/Themes/{2}/Views/{1}/{0}.cshtml",
"~/Plugins/MyPlugin/Views/{1}/{0}.cshtml"
};
Then I register view engine from Route file like:
ViewEngines.Engines.Insert(0, new CustomPluginViewEngine());
and
ViewEngines.Engines.Insert(0, new MyPluginViewEngine());
respectively.
Now, both of this plugin has _productBox.cshtml page with their own model.
Both plugin's functionality won't work together for this page, if both are installed. If only one is installed then it works fine.
Hope this will helps you to understand my problem clearly.
I have created two plugins. 1. CustomPlugin 2. MyPlugin
I use _productBox.cshtml view page in both plugin.
Now, I have used View Engine in both plugin like:
-->For CustomPlugin
PartialViewLocationFormats =
new[]
{ //themes
"~/Themes/{2}/Views/{1}/{0}.cshtml",
"~/Plugins/CustomPlugin/Views/{1}/{0}.cshtml"
};
--> MyPlugin
PartialViewLocationFormats =
new[]
{ //themes
"~/Themes/{2}/Views/{1}/{0}.cshtml",
"~/Plugins/MyPlugin/Views/{1}/{0}.cshtml"
};
Then I register view engine from Route file like:
ViewEngines.Engines.Insert(0, new CustomPluginViewEngine());
and
ViewEngines.Engines.Insert(0, new MyPluginViewEngine());
respectively.
Now, both of this plugin has _productBox.cshtml page with their own model.
Both plugin's functionality won't work together for this page, if both are installed. If only one is installed then it works fine.
Hope this will helps you to understand my problem clearly.
I think you should return views with path instead of writing view engine in plugin(I have also experienced this ) .Hope It will solve your problem.
Code will like bellow
return View("~/Plugins/MyPlugin/Views/_productBox.cshtml",model);
Or you can write Unique file name.