Help with Unity: Method Resolve

Topics: Building and extending application blocks, Enterprise Library Core, General discussion
Feb 1, 2013 at 4:47 PM
Initially this project was developed in PC x86 32bit compilation and had the following:
  • Visual Studio 2010
  • Enterprise Library 4.1
  • Unity 1.2
and was installed in PC, but the compilation of the project remained in x86

Now we AnyCPU passing it to the following:
  • Visual Studio 2010
  • Enterprise Library 5
  • Unity 2.1
and when I run the project falls in the code: ontainer.Resolve (Of frmFormulaProvider) ()

This is the code:
Dim container = SIQHFactory.Instancia
     Is Nothing Then If Me.Instance
         Me.View = container.Resolve (Of frmFormulaProvider) ()
         Me.View = container.Resolve (Of frmFormulaProvider) ()
     end if
And get this message:
Error 22 'Public Function Resolve (t As System.Type, name As String, ParamArray resolverOverrides () As Microsoft.Practices.Unity.ResolverOverride) As Object' has no type parameters and so can not have type arguments.

Now the form has frmFormulaProvider in the constructor:
_ <Microsoft.Practices.Unity.InjectionConstructor()>
 Public Sub New (ByVal container As IUnityContainer)
     'This call is required by the Windows Form Designer.
     InitializeComponent ()
     Me._objIConceptoOrigenService = container.Resolve (Of SIQHServiceAccess.IConceptoOrigenService) ()

     'Add any initialization after the InitializeComponent () call.

 End Sub
The issue is that everything worked properly before, but now with this change falls.

Even with all of the solution and changing it to compile as AnyCPU was:
  • Visual Studio 2010
  • Enterprise Library 4.1
  • Unity 1.2
    Salia error in the constructor calls to Unity.
I need urgent help!
Feb 2, 2013 at 5:48 AM
Edited Feb 7, 2013 at 5:16 AM
I wasn't able to recreate the issue you are seeing based on your posting. Perhaps if you could create small sample application that demonstrates the issue it would help pinpoint the issue.

Randy Levy
Enterprise Library support engineer
Support How-to