Create and join a chat room and participate in chat (SampleChat)
Learn about the Microsoft Lync Server 2013 Persistent Chat SDK SampleChat application.
Applies to: Lync 2013 | Lync Server 2013
Note
By default, the SampleChat application is copied to the %ProgramFile%\Microsoft Lync Server 2013\Persistent Chat SDK\SampleChat folder. SampleChat and related code samples can also be downloaded from the MSDN Code Gallery.
This sample application shows how to use the Microsoft Lync Server 2013 Persistent Chat API to complete the following tasks:
Connect to a Lync Server 2013 Persistent Chat on a UserEndpoint-based PersistentChatEndpoint.
Create and join a chat room.
Participate chat in the chat room.
Get the chat history from the chat room.
Search the chat history of a chat room.
Leave the chat room.
Disconnect from the Lync Server 2013 Persistent Chat and the underlying Lync Server 2013.
To set up the project in Visual Studio 2010
On the Microsoft Visual Studio 2010 File menu, point to New, and then choose Project.
In the Project types pane, choose Visual C#, and then choose Windows.
In the Templates pane, choose Console Application.
In the Name box, enter the name of the project, and then click OK. Visual Studio creates a new project.
In the Solution Explorer, right-click Properties under the newly created project, and then click Open.
In the newly opened Properties tab in Visual Studio main window, set Platform target to either x64 or AnyCPU under the Build option, and then set Target framework to .NET Framework 4 under the Application option.
In the Solution Explorer, right-click References under the newly created project, and then select Add Reference.
Select the Browse tab, navigate to the Microsoft Lync Server 2013 Persistent Chat SDK installation directory, and then select the Microsoft.Rtc.Collaboration.DLL and Microsoft.Rtc.Collaboration.PersistentChat.DLL assembly files.
To add the source code to the project
Replace Program.cs with the SampleChat.cs.
Add SampleCommon.cs to the project.
Press F5 to run the application in Debug mode.
Requirements
Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 development system
.NET Framework 4.5. (installed automatically with Visual Studio 2012 or separately with Visual Studio 2010)
UcmaRedist.msi
UcgcRedist.msi
See also
Concepts
Learn the basics of Lync Server 2013 Persistent Chat SDK
How to use Persistent Chat API (Lync Server 2013 Persistent Chat SDK)