Dynamic compilation & post-compile steps like PostSharp possible?

Topics: Writing modules
Mar 23, 2012 at 11:12 AM

Does anyone know if you can use PostSharp inside an Orchard module?

Will the dynamic compilation run the post-compilation step required for PostSharp?

Mar 30, 2012 at 9:20 AM

None of the core devs know either? :/

Coordinator
Apr 1, 2012 at 2:16 AM

What's PostSharp?

Apr 1, 2012 at 9:44 AM
bertrandleroy wrote:

What's PostSharp?

See http://www.sharpcrafters.com/

Coordinator
Apr 2, 2012 at 4:14 AM

Yeah, aspect programming seemed promising ten years ago but it never really took off. I have no idea if that can work with Orchard dynamic compilation but I would be extremely surprised if it did.

Apr 2, 2012 at 5:35 AM
Edited Apr 2, 2012 at 5:53 AM
bertrandleroy wrote:

Yeah, aspect programming seemed promising ten years ago but it never really took off. I have no idea if that can work with Orchard dynamic compilation but I would be extremely surprised if it did.

Well, we use it at work where deemed useful.

I'll guess I try it out and report back @ here :)

edit: Dynamic compilation skips the PostSharp step, pre-compiling the project does work though as expected.

Coordinator
Apr 3, 2012 at 2:13 AM

I'm not saying it's not useful, it's a neat concept. I'm just saying that it never took off ;)

Jun 6, 2014 at 10:19 AM
It took off a bit more since then...

Would it be possible to 'configure' the dynamic compilation by Orchard so that it uses either pre-compiled DLL's for a certain module (built by Postsharp in this case), but make that an option. This way the default dynamic compilation won't be affected. (not sure if Orchard works exactly this way though...)
Jun 6, 2014 at 10:20 AM
RobertWebcare wrote:
It took off a bit more since then...

Would it be possible to 'configure' the dynamic compilation by Orchard so that it uses either pre-compiled DLL's for a certain module (built by Postsharp in this case), but make that an option. This way the default dynamic compilation won't be affected. (not sure if Orchard works exactly this way though...)
I would love that feature (hello fellow PostSharp user) as currently we cannot use PostSharp directly as the dynamic compilation skips the PostSharp steps.
Jun 6, 2014 at 10:38 AM
Yeah I can see how things go wrong, but I don't know how the dynamic compilation is built exactly in Orchard. Hopefully someone else might be triggered by my suggestion to have Orchard use 'pre-compiled' dll's as input for dynamic compilation.

However, this being a potential technical solution. I'm also not sure about the functional specifications regarding dynamic compilation. It might not be so trivial to just move or alter the steps involved.

So.. now we wait for someone with inside knowledge on dynamic compilation
Developer
Jun 8, 2014 at 3:39 AM
From the top of my head, without digging to refresh my memory: there is an extension loader that deals with compiled extensions, called the PrecompiledExtensionLoader. Try to just compile the modules manually and then refresh the local site, not just refresh it to let dynamic compilation do the job. This way Orchard will use the already compiled module, where you can employ any customization. I think...