This project is read-only.

Dynamic compilation sometimes working, sometimes not

Topics: Core, Troubleshooting
Oct 18, 2012 at 10:00 PM

I realize this is extremely vague, but it's what I've got: somehow dynamic compilation got broken on most of my Orchard instances (strictly speaking about local dev instances here, although I think this also happened for a production site but let's stick with this), but not all and sometimes I realize dynamic compilation is working again.

I experienced all the troubles after updating to 1.5.x (all instance in question are > 1.5), before that never a problem.

The issue exists for me with the latest source as well, with a completely clean instance (downloaded fresh source, run site) but am experiencing with sites originally installed with 1.3, 1.4, 1.5 and a late-summer 1.x as well.

My concrete "test" with the latest source: running in Debug mode. ContentPickerField attached to Page. First run: checking if everything OK, everything is OK, Content Picker displays "No content items." on the home page's page. Removing GetDifferentiator() method from ContentPickerFieldDriver. Expected: compile error. Result: got the previous result, code running without errors.

Can it be that this has to do something with my dev environment? VS, Windows? I'm running on Win 7 Pro, tried with VS 2010 and 2012 as well, with the latest source too.

Anybody with an idea?

Oct 19, 2012 at 7:41 PM

Now I tried it with messing up AutoroutePartDriver. Still no effect, although I see the exceptions from DefaultVirtualPathMonitor that are thrown on startup on localhost.

Oct 23, 2012 at 8:46 PM

Now tried with 1.6 RC. As per Sebastien's suggestion, I added the following line to the end of WidgetFilter.OnResultExecuting(), but nothing happens:

zones["AsideFirst"].Add("Foo", "1.0");

Oct 23, 2012 at 9:44 PM

Actually it has to be inserted just after the foreach loop.

Oct 23, 2012 at 9:47 PM

Yeah, that's what I've done. It works if I rebuild manually.

Oct 23, 2012 at 10:00 PM

I've just made some testing with 1.6 RC and the latest (#6667) 1.x source using the modification Sébastien suggested. To sum up, it doesn't work, neither in Debug or Release mode. I also tried activating the HostComponents.config file but with setting the Disabled property to false, still no joy.

The funny thing is that it works (for changing a String in one of the .cs files) in a 1.6 RC instance with one of the Scripting Extension modules, but the WidgetFilter.cs modification doesn't work in this case either.

Oct 23, 2012 at 10:32 PM

Its not working for me either.

Oct 24, 2012 at 10:11 AM
Edited Oct 26, 2012 at 6:10 PM

Just did a little more investigation: as I mentioned above, Dynamic Compilation works for me in a custom module. I compared that module's web.config to eg. Orchard.Widget's web.config but they all are completely identical.

Zoltán's idea was that it may matter whether the reference to Orchard.Core and Orchard.Framework is a project or assembly reference; but it doesn't matter... Changing the references to the other type didn't help Orchard.Widgets and didn't break the custom module.

Oct 26, 2012 at 6:52 PM

Thanks both of you for testing! Opened a ticket for the issue.

Oct 26, 2012 at 10:29 PM

I'm having the same problem - Win 7x64 VS 2010 IIS Express; again tried Sebastien's suggestion from the weekly meeting (described above) with no joy

Jul 25, 2013 at 2:29 PM
Using 1.6.1 I'm also still having this problem. More details can be found in my comment to the corresponding bug (dated 2013-07-25).