none
UserControl/HostedControl Errors (newbee to CCF) RRS feed

  • Question

  • Hi,

    Firstly, I am totally new to MS CCF. I went on a 2 day training course just before Christmas last year - so its all new to me.

    My application started its life as a .NET user control, which I changed as shown in the MS CCF course notes and Developer Documentation to be a HostedControl.

    The control is simple, you input an Account ID, click Search, and it calls a couple of SQL stored procedures and populates databound fields and a DataViewGrid. This works fine when using the control in a simple win form app which references the control.

    Now comes the bit where I am having difficulties. I should mention I am using a pre-built (i.e. not by me) CCF environment. I have used the Admin Console on our CCFDC to create an instance of my hosted application. I have performed the Application Mappings configuration too. (Is there anything else I should do?)

    When I start an Agent Desktop, as a valid Agent user on a client machine, I get the following error :-

    "Error Hosted Application "Demo App" could not be created. Contact the CCF administrator.
    Could not load type "CCFDemoApp" from assembly 'CCFDemoApp', Version:1.0.0.0, Culture=neutal, PublicKeyToken=null'.

    I'm sure there is a simple solution, but being a novice in this area, I just can't see where I am going wrong.

    Thanks for your help.

     

    Alan

    Tuesday, January 30, 2007 5:27 PM

Answers

  • Hi Matt,

     Thanks for the response.

    I eventually sorted the problem. The problems that I was experiencing were down to a few things....

     1) The namespace in my control was just a simple namespace, e.g. MyNamespace. But a colleague suggested changing the namespace to something like: Microsoft.Ccf.<mynamespace>

    2) Ensure my control was defined as:

    public class  <mycontrolclassname> : Microsoft.Ccf.Csr.HostedControl


    Which was the case even during the errors.

    3) App initialisation in Admin Console:

    URL: <path of the dll>            This was correct, and the path can be anywhere on the local drive

    Type: needs to be  <namespace>.<classname>   e.g. Microsoft.Ccf.<mynamespace>.<mycontrolclassname>

    4) The laptop on which I was doing the development had the CCF2005 framework, which I built against. The environment on which I was trying to run my hosted control on, seemed to have a later version, CCF2006? My Microsoft.Ccf.Csr.Core.dll had a version of v2.5.0.0 and on the other systems we have v2.6.0.0. I therefore re-built my code on a system with v2.6.0.0.

    5) The dll has to be on the client machine where Agent Desktop is run, with the same path as it is defined in Admin Console.

     And I think that was it. After all that, the Agent Desktop successfully hosted the control.

    Hope this helps other new people!

     Cheers

     Alan

    Thursday, February 1, 2007 2:08 PM

All replies

  • That error generally appears if you didn’t add the CCF Hosted control Constructor..
    CCF uses a different constructor to instantiate the control,

    An example of it is here :

    public DemoApp ( int appID , string appName , string initString ) : base ( appID , appName , initString)
    {

    InitializeComponent();

    // Your init code

    }

    Let me know if that’s it..

    If not, can you post the Class constructors here and the XML that’s show in the Admin console when you right click on the adapter and choose properties.

    thanks !

    Tuesday, January 30, 2007 9:13 PM
    Moderator
  • Hi Matt,

     Thanks for the response.

    I eventually sorted the problem. The problems that I was experiencing were down to a few things....

     1) The namespace in my control was just a simple namespace, e.g. MyNamespace. But a colleague suggested changing the namespace to something like: Microsoft.Ccf.<mynamespace>

    2) Ensure my control was defined as:

    public class  <mycontrolclassname> : Microsoft.Ccf.Csr.HostedControl


    Which was the case even during the errors.

    3) App initialisation in Admin Console:

    URL: <path of the dll>            This was correct, and the path can be anywhere on the local drive

    Type: needs to be  <namespace>.<classname>   e.g. Microsoft.Ccf.<mynamespace>.<mycontrolclassname>

    4) The laptop on which I was doing the development had the CCF2005 framework, which I built against. The environment on which I was trying to run my hosted control on, seemed to have a later version, CCF2006? My Microsoft.Ccf.Csr.Core.dll had a version of v2.5.0.0 and on the other systems we have v2.6.0.0. I therefore re-built my code on a system with v2.6.0.0.

    5) The dll has to be on the client machine where Agent Desktop is run, with the same path as it is defined in Admin Console.

     And I think that was it. After all that, the Agent Desktop successfully hosted the control.

    Hope this helps other new people!

     Cheers

     Alan

    Thursday, February 1, 2007 2:08 PM
  • Good to hear!.

    just a few comments.

    The versions you saw there work out as such
    v2.5.0.0 == CCF 2005
    v2.6.0.0 == CCF 2005 .net 2.0 edition

    If you add the a using entry for Microsoft.Ccf.Csr  you can avoid the need to fully qualify the class..

    On Namespaces... You dont need to use Microsoft.CCF. <yournamespacehere>  it can be anything you want it to be.
    you just need to follow the schema that you mentioned when adding it to the Hosted Applcation List <namespace>.<classname>

    note: there is a slight difference in how providers are entered into the Admin System 
    take a look at the Configuration folder in the AdminConsole and look at the AgentCredentialsWS entry provider for an example of how that looks.

    You will only need to do that if you are overriding CCF Server functions though.. AgentCredentials provider for example is the SSO interface provider.

    MattB MSFT

    Thursday, February 1, 2007 2:28 PM
    Moderator
  • Matt,

    Thanks for your help and clarification on the namespaces.

    Regards

    Alan

    Thursday, February 1, 2007 4:19 PM