Changes wich forces a Module Disable/Enable

Topics: Writing modules
Oct 16, 2012 at 10:07 AM


i'm trying to add a new items/subitems/images to the AdminMenu.  My Module is enabled.

If start Debug and go to the Dashboard, the changes are not displayed even though while debugging the new code were excecuted.

I wonder, deleted the App_Data folder, after that, the AdminMenu changes were displayed.

My Question: Wich actions (changes in the code) will force to Disable/Enable the Module and in what cases i need to delete the App_Data folder.



Oct 16, 2012 at 11:23 AM
Edited Oct 16, 2012 at 11:23 AM

If you're using Debug, most likely you're using Visual Studio.

Try Clean and then Rebuild on your module's Project, if that doesn't work "touch" the .csproj of the module and Orchard's dynamic compiler should kick in and update the dependencies.

You can also manually delete the DLL for your module from app_data\dependencies but sometimes IIS or the worker process will have locks in it, iisreset in Start > Search Text Box before you delete fixes it.

However that does depend on the change! Css, images, views and other static content you don't need the steps above.

Hope this helps,



Oct 16, 2012 at 12:06 PM

Thanks for quick answer. Good advice to delete the DLL, but i wonder that the debugger fetch the correct code. Anyway, i now try always to work with an open commanline and disable/enable - benifit, i do not have to start the Webbrowser, errors in the module will diplayed in the commandline.

Are you sure for images? I try to add an own image to the Admin Menu. Cause it didn't work i change the image from the Blog AdminMenu, it has no effect, i can do what i want, the image is still the same (rename/delete/paint in it).

So, i try again... like Orchard ;)

Oct 16, 2012 at 12:15 PM

Ok, maybe here is that what my problem occurs.

I try to delete the Dll. I got a message that it's open by the ASP .Net Development Server.

I close the Server.

Now i got the message it's open by Orchard. So I exit Orchard in the commandline.

Could  this be the reason for my problems? How do you work to be sure to excecute the latest changes? Always delete the Dll?



Oct 16, 2012 at 12:19 PM
Edited Oct 16, 2012 at 12:20 PM

Yes, orchard.exe will lock it, i wouldn't advice you using it for this purpose, let orchard do it's magic :)

Next time try those steps I described:

  1. Do your change
  2. Stop dev server and/or IIS and/or orchard.exe
  3. Clean project and then rebuild
  4. Press debug or do Ctrl+Alt+P to attach to the worker process
  5. Orchard should recompile and update the dependency

If this doesn't work, replace step 3. with delete dll from app_data\dependencies.

About the image change, there's other factors to consider, image caching, browser caching, etc. the steps above are for code only.