Nop showing erros in delployed but not when run from VS2010

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi all,

I have this strange problem which I am stuck with for 2 days now :/

I've added my own functionality to the Nop to show a message to visitor based on their ip-derived location. The problem I have is that when I hit the debug button (or run without debugging) it runs fine and shows the message.

However when I run deploy.bat and point IIS7 to the Deployable\nop_2.0 it breaks with following error:

A public action method 'GeoMessage' was not found on controller 'Nop.Web.Controllers.CatalogController'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A public action method 'GeoMessage' was not found on controller 'Nop.Web.Controllers.CatalogController'.

Source Error:


Line 6:  </div>
Line 7:  
Line 8:  @Html.Action("GeoMessage", "Catalog")
Line 9:  <div class="clear">
Line 10: </div>

Source File: d:\projects\PKI-COM\Deployable\nop_2.0\Views\Home\Index.cshtml    Line: 8


My changes are as follows. I've added a

        #region ITidea
        [ChildActionOnly]
        public ActionResult GeoMessage()
        {


method to catalog controller.
I've added a GeoMessage.cshtml view to the Views\Catalog folder and I've created a model in GeoMessageModel.cs in Models\Catalog.

This is especially strage since I've added other methods to the the Catalog controller before and it worked fine. It feels like I can't have done anything wrong since my code IS WORKING fine in debugger.

Gentelmen - your help is most appreciated.

Filip
12 years ago
Using reflector (or justdecompile) on the deployed .dll's, do you see your new method?
12 years ago
fkierzek wrote:
Hi all,

I have this strange problem which I am stuck with for 2 days now :/

I've added my own functionality to the Nop to show a message to visitor based on their ip-derived location. The problem I have is that when I hit the debug button (or run without debugging) it runs fine and shows the message.

However when I run deploy.bat and point IIS7 to the Deployable\nop_2.0 it breaks with following error:

<stuff deleted>

Gentelmen - your help is most appreciated.

Filip


Maybe you just need to take a break, sometimes that helps. Did you run prepare? I added just a blank GeoMessage with no body, compiled it, ran prepare, deploy and copied the entire depolyable to the server and it worked.

Strange things happen to me sometimes. It drives me nuts. I didn't try Action or RenderAction, I assume it has nothing to do with the problem.

pointer to the controller:
        @Html.ActionLink("GeoMessage", "GeoMessage", "Catalog");

controller:
        #region ITidea

        public ActionResult GeoMessage()
        {
            return View();
        }

        #endregion
12 years ago
MarioRosario wrote:

Maybe you just need to take a break, sometimes that helps.

Tried that, but it didn't help.

[quote]
Did you run prepare?
[/quote]
No. The deploying.readme says deploy does what prepare does and also it moves the files to correct folder. Do I need to run both Prepare and Deploy?

I just tried running prepare and deploy - same effect.

theonlylawislove:
I Downloaded & installed Telerik decomplier and there is no trace of my GeoMessage() in CatalogController. However I can see in the decompiled code another method I've added a bit earlier ..

This is starting to get really strange ...

Filip
12 years ago
OK - case closed it seems..

deploy.bat is broken .. don't know why but it seems to be moving old dlls to the deployable/nop2 directory .. which is a bit strage cause I am sure it worked before ..

Anyway I did a publish from VS, moved it to the server and 3 days after I finished coding you can finally admire a flag of the country you're in on http://polskaksiegarniainternetowa.com/ :-)

Thanks to everybody for a sanity check!

Filip
12 years ago
fkierzek wrote:
OK - case closed it seems..

deploy.bat is broken .. don't know why but it seems to be moving old dlls to the deployable/nop2 directory .. which is a bit strage cause I am sure it worked before ..

Anyway I did a publish from VS, moved it to the server and 3 days after I finished coding you can finally admire a flag of the country you're in on http://polskaksiegarniainternetowa.com/ :-)

Thanks to everybody for a sanity check!

Filip


Congrats. I clicked on the link and it took one second to bring up your home page. I do see the USA flag. I'll try it again soon, I'm not sure I'm seeing my browser cache.
12 years ago
MarioRosario wrote:
OK - case closed it seems..

deploy.bat is broken .. don't know why but it seems to be moving old dlls to the deployable/nop2 directory .. which is a bit strage cause I am sure it worked before ..

Anyway I did a publish from VS, moved it to the server and 3 days after I finished coding you can finally admire a flag of the country you're in on http://polskaksiegarniainternetowa.com/ :-)

Thanks to everybody for a sanity check!

Filip

Congrats. I clicked on the link and it took one second to bring up your home page. I do see the USA flag. I'll try it again soon, I'm not sure I'm seeing my browser cache.


Come to think of it, I did run into a similar thing on VS 2010, never happened to me in VS 2008, for 2 days VS2010 did not impliment a minor change until I restarted Visual Studio. I don't know if there is a state where VS2010 does something funny.
12 years ago
MarioRosario wrote:

Congrats. I clicked on the link and it took one second to bring up your home page. I do see the USA flag. I'll try it again soon, I'm not sure I'm seeing my browser cache.


It's a cache all right, but not your browser. I've added output caching to home page tags, categories and homepage products. See the thread about speeding up nopcommerce - I've posted info how to do it there.
12 years ago
I have installed the database with success the very first time.
When redirected to the home page I get a browser error.
The log table records has the following error which happens every time I try to run the app from VS 2010 in debug mode:  

Path '/Views/Home/Index.cshtml' was not found. when run the project from VIsual Studio 2010.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.