Orchard 1.8 Can't Enable Custom Module - orchardcms

I am in the process of upgrading from Orchard 1.7 to 1.8. Everything seems fine locally, but when I deploy my site, 1 of my custom modules is disabled. When I click the "Enable" link in the modules section of the dashboard, the page refreshes, but the module is still disabled. My local instance is connected to the same database and shows the module enabled so not really sure what is happening. I don't see any details in the standard error logs.
Is there any way to see any errors that could be causing a module to fail being enabled?
Thanks

This turned out to be due to a case mismatch in my feature name vs my module folder name. My module was originally named in Pascal case ie. 'MyModule'. Somewhere along the way my folder had gotten renamed to 'Mymodule' while the Module.txt file still listed the primary feature as 'MyModule'.
I finally hunted this down by copying the Orchard.Modules.pdb file into the bin folder of my precompiled web application and attached the VS debugger to it to see what was going on. The issue presented itself inside of Orchard.Modules.Controllers.AdminController.Features() where a comparison of FeatureDescriptor.Id == ShellFeature.Name failed to match on account of the case mismatch. The result was that my feature was being shown as disabled even though it is enabled in the database.

Not a direct answer to your question but did you do a complete rebuild before publishing your orchard site (assuming that is how you deployed it)? I have found that sometimes you have to do a rebuild all before publishing.

Related

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies error while publishing my MVC .net 3.1 core project to Azure

Not sure what details I should be providing to be completely honest, other than I googled and searched for this solution and I deleted everything and retried and didnt work out, I downloaded all the files needed, I added application settings and it added an error for me telling me that I need to install or update Microsoft.WindowsDesktop.App, version 3.1.0, which I have installed and already existed anyway
I tried going to application event logs on Azure portal, there was 3 errors first this one which some people suggested going to web.config and changing it to Module not v2, and I dont see any web.config file in my mvc project
2nd error which I already talked about but its just not working, so I assume somehow its not seeing it??
3rd error Also this I am not quite sure what to do with it.
Lastly, as I said I am not sure what information I should provide, I dont have much time and I was asked to publish it on azure there was no problems and seemed easy but errors popped up and nothing on the internet fixed my issues, you can comment and I will add any required data to fix this.
Thanks in advance
I installed each and every package in the dotnet folder to make sure everything is right and everytime it recognized there is a file already and asked me if I want to repair I said yes but that didnt help
I checked my .json file if it had any errors like some people suggested
checked if Azure portal specified that I am using ASP.NET 3.1core which it did
~~I used search for "stdoutLogFile" to check if I can find it anywhere on my solution since I cant find my web.config but I there was no result~~
I found out that I can add the web.config and make changes to it, and I did so but there was no result for it, still same error (yes I change the publish profile and republish to make sure it took the changes)
[enter image description here][1]
[1]: https://i.stack.imgur.com/rgiVi.png I got these errors when I opened the profile.arm.json folder under the server dependency folder

Orchard CMS: Where new theme structure and files get saved when installed from Gallery

I have a couple of general questions please. Just stepping into Orchard CMS. So apology if they look stupid!
Today I installed a theme called Metro from Theme Gallery. It is visible on theme selection page as well. But where the files and folder structure are got saved in Orchard CMS? I looked into Theme folder but it is not there. I want to see how the structure is placed so that I can create one myself
One more thing. Theme .png file shows a nice layout but when I activate it the layout comes up completely different. Why is this?
And finally, I installed my site using Orchard's web interface and it is running fine. But when I tried to run orchard > codegen theme CreditLine, it said Command codegen doesn't exist.
I then run Setup utility from command prompt (orchard >) and it displayed
A previous Orchard installation was detected in this database with this table prefix.
Which clearly says the setup I did through web interface was successful. But still I am not able to run codegen command or even help codegen. The latter command shows Command codegen doesn't exist!
Orchard version: v.1.10.1.0
1) It should be installed under Themes/TheThemeName, or locally, under src/Orchard.Web/Themes/TheThemeName
2) It could be that you installed an old theme. Not sure because you don't give many details over what goes wrong.
3) You first have to enable the codegen module. Do this by starting up your Orchard, go to modules => Codegen => Enable. Or run in the orchard.exe: feature enable Orchard.CodeGeneration
After a lot of Googling and struggle I found a nice community here where I got my answer!
Orchard Repository on Github defaults to dev branch which I overlooked completely when cloned it for the first time! So I removed everything from my local and cloned the source again but from master branch this time.
No more compilation error or Command Line issue popped up. Orchard.CodeGeneration feature got enabled from CLI this time without a problem. Everything else seems to be working fine as well.
Steps:
1. Removed source from my local which I cloned from dev branch initialy
2. Cloned Orchard from master branch
3. Opened solution in VS2015
4. Compiled, run and setup my first site
5. And finally ran feature enable Orchard.CodeGeneration from orchard command prompt.

SiteMapPath empty after upgrade to MVCSiteMap 4

I just attempted to update the site map provider from 3.3.6.0 to 4.0.14. I followed the instruction on the wiki however my SiteMapPath now renders empty. I made no changes to the mvc.sitemap file other than updating the schema to 4.0. When I debug into the SiteMapPathHelperModel I find that the model has no nodes defined. I am using the internal DI container (I would like to get this working before switching over to the application container).
When I check the sitemap.xml file it is well populated which makes me think that the mvc.sitemap is being read.
I'm out of ideas on this one and would be happy to provide any additional information which may be useful. I'm not even sure where I can hook into debug this problem. Literally the only thing I changed between a working 3.3.6.0 and a not working 4.0.14 was what was prescribed on the wiki.
Ok, since your /sitemap.xml endpoint appears to be working, you are correct the sitemap is being populated and loaded correctly.
There are a couple of things I know of that can cause this to happen:
If you are using Dynamic Node Providers, they must be added to a node that is not otherwise part of the sitemap. See my question here - I am trying to figure out why this is the case as well.
Your routes don't match your nodes - please read Routing Basics and/or post your routes and Mvc.sitemap XML.
If you check the above and everything appears to be correct, please make a small demo project showing a sample of your configuration and open an issue on GitHub, as it is highly likely your specific configuration has something to do with the problem.
BTW - You can debug by cloning the current repo on your system or downloading the solution as a zip, enabling NuGet package restore on your solution (right click the solution > Enable NuGet Package restore), add the MvcSiteMapProvider project to your solution, and then in your project remove the reference to MvcSiteMapProvider and add the reference to the newly added MvcSiteMapProvider project from your MVC project. Then you can add breakpoints and step through the code. I suggest making a backup of your solution (or ensure you can roll back another way) before doing this, and reverting back to your current state when done.
I have documented the whole procedure here: http://www.shiningtreasures.com/post/2013/08/21/debugging-an-mvcsitemapprovider-configuration

How to publish MSHTHML.dll and SHDOCVW.dll to Azure

I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets me target a URL and save the page to a image file. I've moved this code into my Azure-based project and when I run it on my local sandboxed dev box and save to the Azure blob, everything is fine. But when I push the bits to my live server on Azure, it's failing.
I think this is because either MSHTML.dll and/or SHDOCVW.dll are missing from my Azure configuration.
How can I get these libraries (plus any dependent binaries) up to Azure?
I found the following advice on an MSFT forum but haven't tried it yet. http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/0344dcff-6fdd-4479-a3b4-3e89750a92f4/
Hello, I haven't tried mshtml in the cloud. But generally speaking, to
use a native dll in a Web Role, you add the dll to the Web Role
project just like adding a picture (choose add existing items). Then
make sure the Build Action is set to Content. This tells Visual Studio
to copy the dll file to the output package.
Also check dependencies carefully. A lot of problems related to native
code are caused by missing dependencies, such as a particular VC++
runtime dll.
Thought I'd ask here first before I burn a day or two on an unproven solution.
EDIT #1:
it turns out that our problem was not related to MSHTML.dll or SHDOCVW.dll missing from the Azure server. They're there.
The issue is that by default new server instance have the IE security hardening feature enabled, and this was preventing our 3rd party dll from executing script. So we needed to turn off the enhanced IE security configuration settings. This is also a non-trivial exercise.
In the meantime, we just created a server-side version of the feature on our site we need to make screen captures from (e.g. we eliminated JSON-based rendering of UI on the client), and we were able to proceed.
I think the solution mentioned in the MSDN forum thread is correct. You should put them as part of your project files, so that the SDK will package and deploy them to the VM on the cloud.
But if they are COM and need to be registed you'd better call the register command via the Startup feature. Please check http://msdn.microsoft.com/en-us/hh351539
HTH

SharePoint 2010 GAC deployment doesn't update

The following issue just crept up on me. The steps mentioned below had worked just fine until about 2 days ago.
When I deploy a update to a solution (of web parts) to a SharePoint 2010 server I don't see the update. The solution does get installed, but from what I can tell the installed web parts are over a month old (nothing new is installed).
I do the following steps through PowerShell:
retract the solution from the web app
remove the solution
add the solution
install the solution to the web app
I have tried restarting the Web App, restarting IIS and also restarting the server. Nothing seems to work.
I notice that after I remove the solution it does get removed from the GAC. After I add/install it the solution does reappears in the GAC.
Am I missing something? Am I overlooking a step that I should be doing? Something to try?
I never deactivated/reactivated the Feature.
After following the same steps I mentioned in my question I just deactivated, then reactivated, the Feature and everything started to working fine.
This is an easy thing to I can start to implement with my solution updates. However, why did I never have to do this step before?
In general, you should check your ULS log to see which version of your solution is running. If you see the old one, then you can be sure that your activated site feature is still bound to the old version. In this case you have to Inactivate the site feature indeed to loose that tie and then Activate to bind to the new one (it appears Activate always ties the site feature to the newest version of the solution).
Maybe you had not to do this earlier, because you did not change the version number of your solution, appearing as the same version in GAC on the server. In this case you had your site feature already pointing to the correct version of your solution, therefore didn't have to reset the feature.
You have probably checked, but just in case. Make sure that the powershell script is not adding a month old package.
Is the problem in the web part code or the configuration? The configuration usually unghosts itself sooner or later and refuses to update from the solution - you can update the file in the gallery manually if anything has changed there. For most updates there won't be any changes because existing web parts won't get updates applied anyway - they will use new code but old configuration.
If the problem is the code itself, does the assembly appear to the system to be unchanged? All the hardcoded full name references in SharePoint config files mean that usually you are deploying a new assembly but with the same version numbers. This can mean that the system doesn't bother making the update. I have found it very useful to update AssemblyFileVersion (which does not affect binding) on every build and have a page in _layouts that displays the file versions of all the loaded assemblies so I know exactly what is running.

Resources