Name attribute not found - WeOnlyDo Discussion board

Name attribute not found (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Limey, Tuesday, September 16, 2014, 19:16 (3719 days ago)

Any idea on why I might get this pre-compile error?

'WeOnlyDo.Client.SFTP.AttributesArgs' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'WeOnlyDo.Client.SFTP.AttributesArgs' could be found (are you missing a using directive or an assembly reference?)


The code does compile and run, and the name attribute is usable, but just can't be seen by Visual Studio.

wodSFTP.AttributesDataEvent += new WeOnlyDo.Client.SFTP.AttributesDataDelegate(wodSFTP_AttributesDataEvent);


void wodSFTP_AttributesDataEvent(object Sender, WeOnlyDo.Client.SFTP.AttributesArgs[] Args)
{
int i = 0;
int lowerB = Args.GetLowerBound(i);
int upperB = Args.GetUpperBound(i);

for (i = lowerB; i <= upperB; i++)
{
_ExistingRemoteFiles.Add(Args.Name); //Will still build and run with an error on Name
}

}

Name attribute not found

by wodSupport, Tuesday, September 16, 2014, 19:17 (3719 days ago) @ Limey

Limey,

VS is correct (doh!), Args.Name doesn't seem to exist here.. Args is a collection in this event, so perhaps Args[0].Name will exist? Can you try that?

Kreso

Name attribute not found

by Limey, Tuesday, September 16, 2014, 19:26 (3719 days ago) @ wodSupport

very weird, I did have it in my code, but when I copied, it disappeared. Seems the forum doesn't like my variable name of "i" (gets rid of it and the brackets). Here it is with a new variable name.


_ExistingRemoteFiles.Add(Args[ii].Name);


So my code is already the way you are suggesting.

Name attribute not found

by wodSupport, Tuesday, September 16, 2014, 20:29 (3719 days ago) @ Limey

Limey,

I tried to do

Sftp1.ListAttributes("/");

and had this code inside:

void sftp1_AttributesDataEvent(object Sender, WeOnlyDo.Client.SFTP.AttributesArgs[] Args)
{
    foreach (WeOnlyDo.Client.SFTP.AttributesArgs arg in Args)
    {
 Console.WriteLine(arg.Name);
    }
}

it worked correctly for me. No compile errors, no errors during execution. Can you try the same?

Kreso

Name attribute not found

by Limey, Tuesday, September 16, 2014, 22:06 (3719 days ago) @ wodSupport

Same issue.

Could it be a version issue? We are using an old version that has to be used in Visual Studio 2008.

Name attribute not found

by wodSupport, Tuesday, September 16, 2014, 22:07 (3719 days ago) @ Limey

Hi.

I am testing with VS2008 as well, but I'm working with latest one. Can you, just for a test, uninstall yours (keep it safe!) and install at least a trial version, to see if this is some issue that appears only in old versions?

Kreso