Mar 19, 2012 at 3:22 AM
Edited Mar 19, 2012 at 2:26 PM
to take a look at this issue? Drop the following into any module and add a route to it.
you don't even need the controller and route. Drop the code into a constructor of an existing module and watch it break. I used the blog module just for grins to make sure it wasn't something specific to my module.
you should see is that the code will get stuck on returning from the GetServiceInstance call (you will need the ServiceModelEx library from the idesign.net website to use the InProcFactory call. The odd thing is there is a collection of 3 things required for
this to happen.
1) You have to call a method that returns the WCF instance, 2 you have to pass some dynamic value to that method and 3 you have to do it in Orchard.
code below works fine in a normal MVC application. Works fine if GetServiceInstance returns anything other than something created by InProcFactory. Works fine if I don't pass it a dynamic - for instance, if I pass "InProc" directly instead of anyString variable.
I never even use the anyString, passing it in is enough to make it choke. I also never use the wcf service, creating and returning it is enough to choke. This one is odd.
public class DeadlockController : Controller
public ActionResult Index()
dynamic anyString = "InProc";
IWCFService wcfService = GetServiceInstance(anyString);
//Debugger never gets here.
public IWCFService GetServiceInstance(string serviceHostType)
return InProcFactory.CreateInstance<WCFService, IWCFService>();
} // Debugger gets here.
public interface IWCFService
[ServiceBehavior(UseSynchronizationContext = false)]
public class WCFService : IWCFService
throw new NotImplementedException();