Close

Server Error in '/' Application; The resource can not be found error.

CISParts
11 years ago
#3441 Quote
Avatar
  • 5
Hi,
I have a good one here, and I am new to nop-templates..  I am using the ShopAll theme in version 2.65 with Visual Studio 2010 and .NET version 4.0.  I am trying to remove product reviews site-wide.  In order to accomplish this, after reading through this forum and the forum at nopcommerce.com, I found the following instructions:

Open the files C:\inetpub\wwwroot\TFS\CIS\nopCommerce\Presentation\Nop.Web\Views\Catalog\ProductTemplate.SingleVariant.cshtml and C:\inetpub\wwwroot\TFS\CIS\nopCommerce\Presentation\Nop.Web\Views\Catalog\ProductTemplate.VariantsInGrid.cshtml

and remove the following lines:
                    
@Html.Action("ProductReviewOverview", "Catalog", new { productId = Model.Id })
<div class="clear">
</div>

This resulted in the error reported above: which is not very helpful:


Server Error in '/' Application.
--------------------------------------------------------------------------------


The resource cannot be found.
  Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Views/Catalog/ProductTemplate.SingleVariant.cshtml


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1008


Now everything was working perfectly before I made this change.  After I made the change, and got the error, I reversed my changes, not by hand but by using TFS > Source Control Explorer > Undo Pending Changes...  
I recompiled and got the same error.  So the application must have changed or created some file that is not in source control.  Any help would be greatly appreciated.  The application will build, but it will not run, and it give me no information on what might be the problem.  Thanks, Will in TN


Boyko
11 years ago
#3447 Quote
Avatar
  • 1570
Hi CISParts,

I don't think your error is caused by the changes you have described. As if you use the ShopAll theme then the ProductTemplate.xxx files are loaded from the Themes\ShopAll folder and not directly from the Views folder as you have shown. You should have done something else that causes this error.

P.S: Isn't the error because you are trying to open the product template file in the browser? VS usually tries to open the same Razor view file you are editing when you start debugging but these files could not be accessed via web they are used by the MVC framework only.

Hope this helps!

Best Regards,
Nop-Templates.com Support Team
Regards,
Nop-Templates.com Team
CISParts
11 years ago
#3450 Quote
Avatar
  • 5
Thanks.  That does help.  When I changed the requested URL to http://localhost:2619, instead of what it was before, it started working.  You're right.  Basically Visual Studio was trying to open the URL of the .cshtml file I was editing instead of starting the application with the home page.  That's what caused the error, not the code change.  That's why reverting the code change didn't eliminate the error.  I'm new to MVC, so that wasn't obvious to me.  

I will make the code changes to the Shop-All theme, because my goal is to remove the reviews tab from the product page.  Thanks.
CISParts
11 years ago
#3451 Quote
Avatar
  • 5
By the way, I found a much easier way to remove product reviews (in version 2.65), which I have not found in this forum.  
1. Open the administration site and go to Configuration > Settings > All Settings
2. Set the TabSettings.EnableProductReviewsTab setting to false.

-Will