Leaving the domain value null on SMBCredential will result in a null reference exception thrown when attempting to run Connect():
private void Connect()
{
var succeded = SMBClient.Connect(_address, _transport);
if(!succeded)
{
throw new IOException($"Unable to connect to SMB share.");
}
var status = SMBClient.Login(_credential.Domain, _credential.UserName, _credential.Password);
status.HandleStatus();
}
Likely need to include some guard classes to assert that values are not null to throw argument exceptions.
Leaving the domain value null on
SMBCredential
will result in a null reference exception thrown when attempting to runConnect()
:Likely need to include some guard classes to assert that values are not null to throw argument exceptions.