1

我在 Windows 8 Metro 应用程序中使用“agsXMPP”,

    private void loginclick_Click_1(object sender, RoutedEventArgs e)
    {
        if (!string.IsNullOrEmpty(id.Text) && !string.IsNullOrEmpty(id.Text))
            client.Login(id.Text, pwd.Password);
        client.OnLoginResult = success => appendLog("Connection to Facebook established " + (success ? "" : "un") + "successfully");
        client.OnLogout = () => appendLog("Client logged out");
        client.OnMessageReceived = (msg, user) => appendLog(user.name + ":" + msg);
        client.OnUserIsTyping = user => appendLog("The user " + user.name + " " + (user.isTyping ? "started typing" : "stopped typing"));
        client.OnUserAdded = user =>
        {
            appendLog("User " + user.name + " is now available for chat");
            changeContactList(user.name, true);
        };
        client.OnUserRemoved = user =>
        {
            appendLog("User " + user.name + " is not longer available for chat");
            changeContactList(user.name, false);
        };

        txtMsgInput.KeyUp += new KeyEventHandler(txtMsgInput_KeyDown);
    }

在上面的代码中,这一行出现错误,

    client.OnMessageReceived = (msg, user) => appendLog(user.name + ":" + msg);

错误是,

    Error   8   The type 'agsXMPP.protocol.client.Message' is defined in an assembly that is not referenced. You must add a reference to assembly 'agsXMPP, Version=1.1.1.0, Culture=neutral, PublicKeyToken=ff839b81f1debe86'.

如果我注释掉该行并执行。它成功执行并获取聊天中可用人员的列表...我检查了这些链接,

http://jefferytay.wordpress.com/2011/12/16/azure-tableservicecontext-presents-an-error-with-createquery-function/

使用 Nuget 更新 FluentValidation 后出现带有 NinjectValidatorFactory 的奇怪错误

但无法理解,有人能简单地告诉我这个错误吗?. .

提前致谢!

4

1 回答 1

1

这是因为,在这一行

     client.OnMessageReceived = (msg, user) => appendLog(user.name + ":" + msg);

据说缺少味精的参考

否则你使用字符串替换 agsXMPP.client.protocol.message(即 msg)。. .

于 2012-12-24T11:46:01.723 回答