Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • JSuh 6 posts 108 karma points
    Jun 16, 2016 @ 06:49
    JSuh
    0

    Why is the code in my dll not being executed after deploying?

    Hi all,

    I have an umbraco 7.4.3 project in visual studio that inherits the applicationEventHandler class and runs some start up code (registering a custom route).

    namespace MyPlugin
    
    public class MyPopStartUpHandler : ApplicationEventHandler
    {
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            *****my custom*****
            base.ApplicationStarting(umbracoApplication, applicationContext);
        }
    

    This code is in a dll project that is a dependency of the main Umbraco project. compiling this main umbraco project outputs 2 files into the bin directory. one is the main umbraco project dll that is essentially empty (since my start up application code is in the dll myplugin) and the other is the myplugin dll that actually houses my code.

    It works when I execute or debug the main umbraco project from visual studio, but when I try to copy over these 2 dlls into my webmatrix bin directory and try to run the webmatrix web site, the start up application never gets called.

    any ideas why?

  • Cimplex 113 posts 576 karma points
    Jun 16, 2016 @ 08:34
    Cimplex
    0

    Hi JSuh, Try touching your web.config file or restart the application pool. That might help.

    // Herman

  • JSuh 6 posts 108 karma points
    Jun 16, 2016 @ 15:53
    JSuh
    0

    actually, the ApplicationStarted method is being called (i placed a messageBox.Show and the messagebox appeared), but for some reason my routing

    routes.MapUmbracoRoute

    isn't being registered.

Please Sign in or register to post replies

Write your reply to:

Draft