Developing new plugin Config page is not found

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hi everyone i am developing my first plugin in nopcommerce 4.1. I followed the tutorials and everything works fine, the only thing i cant figure out is this exception i get when i click on configure button.

here is the full stack trace.


System.InvalidOperationException: The view '~/Plugins/Chat.MainChatPlugin/Views/Configure.cshtml' was not found. The following locations were searched:
~/Plugins/Chat.MainChatPlugin/Views/Configure.cshtml
   at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.<>c.<UseNopExceptionHandler>b__1_1(HttpContext context) in D:\NopCommerce\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 83
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)



Any help is much appreciated.
4 years ago
Right-click your cshtml file and go to properties. Check 'build Action' is set to 'content' and 'copy to output directory'  is set to 'copy if newer'.

I hope it will solve the problem.
Thanks.
4 years ago
ferdous0905 wrote:
Right-click your cshtml file and go to properties. Check 'build Action' is set to 'content' and 'copy to output directory'  is set to 'copy if newer'.

I hope it will solve the problem.
Thanks.



Thank you for your help. Sadly those properties are already set correctly so that is not the issue.
4 years ago
Please check the plugin folder inside the Nop.Web . If the cshtml file exist then match the spelling of the path.
You may also want to import the _ViewImports.cshtml and don't forget to rebuild the plugin.
Thanks.
4 years ago
ferdous0905 wrote:
Please check the plugin folder inside the Nop.Web . If the cshtml file exist then match the spelling of the path.
You may also want to import the _ViewImports.cshtml and don't forget to rebuild the plugin.
Thanks.


Thanks for your response.

According to the tutorial i have placed my plugin in /Plugins folder on root solution directory and not in nop.web folder should i put my plugin in nop.web?

I have copied _ViewImports.cshtml file from another plugin. Is there anything i should change in this file?
4 years ago
This is the tutorial i am following.

http://docs.nopcommerce.com/pages/viewpage.action?pageId=40304642
4 years ago
Dear ferdous0905,

Sorry for using the wrong account for replying to you. The above two posts are also from me.


Kind Regards,
Mehtab.
4 years ago
When You build your plugin you will find build version of your plugin inside "Nop.Web\Plugins".
So you should find your cshtml in "Nop.Web\Plugins\Chat.MainChatPlugin\Views\Configure.cshtml".

Copy version of other plugins _ViewImports.cshtml should work just fine.

if you can't find your cshtml file inside "Nop.Web\Plugins" folder then you might want to look at your plugins csproj file.
You can take help from other plugins csproj file or check other plugin Notes.txt.

Thank You.
4 years ago
When You build your plugin you will find build version of your plugin inside "Nop.Web\Plugins".
So you should find your cshtml in "Nop.Web\Plugins\Chat.MainChatPlugin\Views\Configure.cshtml".

Copy version of other plugins _ViewImports.cshtml should work just fine.

if you can't find your cshtml file inside "Nop.Web\Plugins" folder then you might want to look at your plugins csproj file.
You can take help from other plugins csproj file or check other plugin Notes.txt.

Thank You.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.