locked
C# Compiler Issue RRS feed

  • Question

  • User908493644 posted

    I am getting a compile error from the following code. If anybody can tell me
    how to get rid of it I would really appreciate it:

    resource = resHierarchy.GetResourceHierarchy(ilhResourceId);
    Utilities.clsResourceID myRes = new Utilities.clsResourceID();
    myRes.Format = resource.Format;
    myRes.Handle = resource.Handle;
    myRes.Name = resource.Name;
    Publish.Publish pub = new Publish.Publish();
    Publish.Publish_Obj_Return retValue;
    retValue = pub.Publish_Ref(myRes, cfg.AppSettings.Settings["userName"].Value, cfg.AppSettings.Settings["password"].Value, 0, 0);

    The compiler error applies to the last instruction and is:
    Error 1 The best overloaded method match for
    'APRService.Publish.Publish.Publish_Ref(APRService.Publish.clsResourceID,
    string, string, int, int)' has some invalid arguments

    Publish_Ref is a web service on another server.

    Utilities.clsResourceID and APRService.Publish.clsResourceID have the same data types.

    I HAVE TRIED EVERYTHING I KNOW TO GET RID OF IT WITHOUT SUCCESS.

    Thanks for any help you can give.

    Friday, October 13, 2006 10:44 AM

All replies

  • User1001868398 posted

    pub.Publish_Ref(myRes.ID, cfg.AppSettings.Settings["userName"].Value, cfg.AppSettings.Settings["password"].Value, 0, 0);

    First parameter? What's the signatures for that method?

    Becuase the method is called _Ref is it asking for you to pass only reference?

    pub.Publish_Ref(ref myRes, ref cfg.AppSettings.Settings["userName"].Value, ref cfg.AppSettings.Settings["password"].Value, 0, 0);

    Please post the definitions

     

    Saturday, October 14, 2006 12:21 PM