.NET 클라이언트 라이브러리 시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Jeff Fisher, Google Data API팀
2007년 8월
소개
그림 1: Google Data API 솔루션
많은 개발자에게 새 프로젝트에서 가장 어려운 부분은 새로운 소프트웨어 패키지를 설치하고, 개발 환경을 구성하고, 새로운 라이브러리를 배우는 등 시작하는 것입니다. 이 도움말에서는 Windows용 Visual Studio 2005 또는 Linux 및 기타 Unix 운영체제용 Mono를 사용하여 .NET 클라이언트 라이브러리를 시작하는 방법에 관한 단계별 안내를 제공합니다. 이 템플릿을 사용하면 시작하는 데 시간을 절약하고 코드를 빠르게 작업할 수 있습니다.
Visual Studio 2008
Visual Studio 2008이 아직 설치되어 있지 않은 경우 .NET 클라이언트 라이브러리를 사용할 수 있는 무료 버전인 Visual C# 2008 Express Edition을 사용하는 것이 좋습니다.
환경 설정
- http://code.google.com/p/google-gdata/downloads/list에서 최신 MSI 버전의 클라이언트 라이브러리를 다운로드합니다.
- 다운로드한 MSI 파일을 실행하여 패키지를 설치합니다. 기본적으로 'C:\Program Files\Google\Google Data API SDK\'에 설치됩니다. 이 도움말의 추가 예에서는 클라이언트 라이브러리가 이 위치에 설치되어 있다고 가정합니다.
- 시작 메뉴의 'Google Data API SDK' 폴더에서 'Google Data API SDK'라는 솔루션 파일을 엽니다.
샘플 컴파일 및 실행
- '빌드 > 솔루션 빌드'를 실행할 때 오류가 발생하지 않는지 확인합니다.
- 디버그 빌드를 만들려면 '빌드 > 구성 관리자'로 이동하여 활성 솔루션 구성으로 '디버그'를 선택합니다. 그런 다음 '빌드 > 솔루션 빌드'를 선택합니다.
- 방금 컴파일한 바이너리 및 DLL 파일은 'C:\Program Files\Google\Google Data API SDK\Sources\Samples\'에서 찾을 수 있습니다. 예를 들어 'C:\Program Files\Google\Google Data API SDK\Sources\Samples\calendar\bin\Debug\Calendar.exe'를 실행하여 Calendar의 샘플 애플리케이션을 실행할 수 있습니다. 이러한 샘플로 연결되는 시작 메뉴 바로가기도 있습니다.
자체 애플리케이션 개발
MSI 파일에서 제공하는 솔루션 파일 외부의 프로젝트에서 개발하려면 클라이언트 라이브러리 DLL 파일을 참조 경로로 추가해야 합니다.
- Google API SDK 솔루션 외부에서 프로젝트를 만들거나 엽니다.
- 프로젝트 메뉴에서 '참조 추가'를 선택합니다.
- '탐색' 탭을 클릭합니다.
- SDK의 Redist 디렉터리('C:\Program Files\Google\Google Data API SDK\Redist')로 이동합니다.
- 코드에서 사용할 DLL 파일을 선택합니다. 대부분의 프로젝트에는 Google.GData.Extensions.dll 및 Google.GData.Client.dll이 필요하며, 애플리케이션에서 사용하는 Google 서비스에 특정한 DLL 파일도 필요합니다.
참고: 휴대기기의 클라이언트 라이브러리용 솔루션 파일도 있습니다. 기본적으로 'C:\Program Files\Google\Google Data API SDK\Sources\Library\VS2005.mobile'에 있습니다. 이 솔루션은 클라이언트 라이브러리의 DLL 파일만 컴파일합니다.
NUnit 테스트 실행
클라이언트 라이브러리를 변경하거나 클라이언트 라이브러리에 기여하려는 경우 적절한 NUnit 테스트를 통과하는지 확인하는 것이 중요합니다. 수정 없이 클라이언트 라이브러리를 사용하려는 경우 일반적으로 실행할 필요가 없습니다.
- http://www.nunit.org/index.php?p=download에서 NUnit의.NET 2.0 MSI 파일 버전을 다운로드합니다.
- MSI 파일을 실행하여 NUnit을 설치합니다. 기본 설치 위치는 'C:\Program Files\NUnit 2.4.8'과 유사합니다. 나중에 Visual Studio 프로젝트에서 경로를 변경하지 않고 NUnit을 업그레이드할 수 있도록 'C:\Program Files\NUnit'과 같은 경로로 변경하는 것이 좋습니다.
- 'C:\Program Files\Google\Google Data API SDK\Sources\Library\VS2005' 디렉터리로 이동하여 'Google Data APIs'라는 솔루션 파일을 엽니다.
Visual Studio 2005 프로젝트 파일이므로 변환 마법사가 표시됩니다. 프롬프트를 클릭하거나 '완료' 버튼을 클릭합니다. 무시해도 되는 전환 로그가 표시됩니다.
- 이제 NUnit을 참조 경로로 추가해야 합니다. 오른쪽의 솔루션 탐색기에서 'unittests' 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 '속성'을 선택합니다. 이제 열린 창에서 '참조 경로' 탭을 클릭합니다. NUnit 설치의 'bin' 하위 디렉터리 위치를 참조 경로로 입력하고 '폴더 추가'를 클릭합니다. 예를 들어 NUnit이 'C:\Program Files\NUnit\'에 설치된 경우 'C:\Program Files\NUnit\bin'을 입력합니다. 계속하기 전에 이 변경사항을 저장하세요.
- 샘플 컴파일 및 실행에 나열된 단계에 따라 클라이언트 라이브러리와 단위 테스트를 다시 빌드합니다.
- 'C:\Program Files\Google\Google Data API SDK\Sources\Library\unittests\"에 있는 'unittests.dll.config' 파일을 디버그 빌드 디렉터리 'C:\Program Files\Google\Google Data API SDK\Source\Library\VS2005\unittests\bin\Debug\"에 복사합니다. 실행하는 테스트에 적합한 정보를 포함하도록 파일을 수정해야 합니다. 예를 들어 Base에는 API 키가 필요하고 Calendar에는 사용자 이름과 비밀번호가 필요합니다. 단위 테스트로 인해 정보가 삭제되지 않도록 실제 데이터가 없는 테스트 계정을 사용하는 것이 좋습니다.
- 시작 메뉴에서 NUnit을 엽니다.
- '파일 > 프로젝트 열기'로 이동하여 'C:\Program Files\Google\Google Data API SDK\Source\Library\VS2005\unittests\bin\Debug\'에서 'unittests.dll' 파일을 선택합니다.
- 관심 있는 단위 테스트를 실행합니다. 특정 테스트가 작동하려면 unittests.dll.config에 매개변수를 설정해야 합니다. 특정 서비스에 대한 스트레스 테스트를 실행하면 테스트 계정이 스팸을 생성하는 것으로 표시되어 보안문자 챌린지 없이 프로그래매틱 방식으로 콘텐츠를 Google 서버에 제출할 수 없게 될 수 있습니다.
모노
Mono는 Linux, Solaris, Mac OS X, Windows, Unix에서 .NET 클라이언트 및 서버 애플리케이션을 실행할 수 있는 오픈소스 프로젝트입니다. 이러한 플랫폼 중 하나에서 작업하려는 개발자를 위해 클라이언트 라이브러리의 별도 ZIP 파일을 제공합니다.
환경 설정
- http://code.google.com/p/google-gdata/downloads/list에서 최신 ZIP 파일 버전의 클라이언트 라이브러리를 다운로드합니다.
- 로컬 디렉터리 (예: '/scratch/gdata.NET')에 추출합니다.
- 배포의 패키지 관리를 사용하여 Mono를 설치합니다.
또는 http://www.mono-project.com에서 다운로드할 수 있습니다.
- 일부 배포에서는 nunit.framework.dll 파일이 mono 라이브러리에 올바르게 연결되어 있는지 확인해야 합니다. mono가 '/usr/lib/mono'에 설치된 경우 '/usr/lib/mono/1.0' 및 '/usr/lib/mono/2.0'에 nunit.framework.dll (이는 '/usr/lib/mono/gac/nunit.framework/<someversionstring>/nunit.framework.dll'에 설치되어야 함)의 심볼릭 링크가 있는지 확인합니다.
샘플 컴파일 및 실행
- 클라이언트 라이브러리를 '/scratch/gdata.NET'에 설치했다고 가정하고 '/scratch/gdata.NET/clients/cs' 디렉터리로 변경합니다.
- 사용할 .NET 버전에 따라 Makefile을 수정합니다. .NET 1.x의 경우
CSC=mcs
를 사용하고 .NET 2.x의 경우 CSC=gmcs
를 사용합니다.
make
를 실행하여 라이브러리와 샘플 애플리케이션을 컴파일합니다.
- 클라이언트 라이브러리 DLL을 Mono 라이브러리에 설치하려면
make install
를 실행합니다.
자체 애플리케이션 개발
클라이언트 라이브러리를 컴파일한 후 make install
를 실행한 경우 사용하려는 특정 서비스 확장 프로그램의 DLL 파일 참조와 함께 -r:Google.GData.Extensions.dll -r:Google.GData.Client.dll
를 Mono C# 컴파일러에 전달하여 자체 코드에 라이브러리를 포함할 수 있습니다.
NUnit 테스트 실행
- '/scratch/gdata.NET/clients/cs/src/unittests'에서 '/scratch/gdata.NET/clients/cs/'로 unittests.dll.config 파일을 복사합니다.
- '/scratch/gdata.NET/clients/cs/unittests.dll.config'를 수정하여 실행 중인 테스트에 적합한 정보를 포함합니다. 예를 들어 Base에는 API 키가 필요하고 Calendar에는 사용자 이름과 비밀번호가 필요합니다. 단위 테스트로 인해 정보가 삭제되지 않도록 실제 데이터가 없는 테스트 계정을 사용하는 것이 좋습니다.
- 라이브러리를 컴파일하면 '/scratch/gdata.NET/clients/cs'에 unittests.dll 파일이 생성됩니다. 선택한 NUnit 테스트 관리자 (nunit-console, gnunit 등)와 함께 이 DLL을 사용합니다.
결론
이제 라이브러리를 컴파일하고 샘플 코드를 실행할 수 있습니다. 하지만 이는 시작에 불과합니다. 클라이언트 라이브러리의 '.../clients/cs/docs' 디렉터리에 있는 문서를 읽어보시기 바랍니다.
.NET 클라이언트 라이브러리 개발자 가이드, 프로젝트 페이지 및 참조 가이드, Google Data .NET 클라이언트 라이브러리 포럼도 확인해 보세요.
이 도움말에서 참조하는 도구는 다음과 같습니다.
다음 .NET 애플리케이션도 잘 만드세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[[["\u003cp\u003eThis guide provides step-by-step instructions for setting up and using the Google Data .NET client library with either Visual Studio 2008 or Mono.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this library to interact with various Google services like Calendar by compiling and running provided sample applications or by developing their own applications.\u003c/p\u003e\n"],["\u003cp\u003eThe guide includes details on compiling the library, running provided unit tests for verifying functionality, and configuring the development environment for both Windows and Unix-based systems.\u003c/p\u003e\n"],["\u003cp\u003eAdditional resources such as the .NET Client Library Developer's Guide and project forums are available for further assistance.\u003c/p\u003e\n"]]],[],null,["# Getting Started with the .NET Client Library\n\n*Jeff Fisher, Google Data APIs team\nAugust 2007*\n\n- [Introduction](#introduction)\n- [Visual Studio 2008](#vs2005)\n - [Setting up your environment](#vssetup)\n - [Compiling and running samples](#vscompile)\n - [Developing your own application](#vsdevelop)\n - [Running the NUnit tests](#vsnunit)\n- [Mono](#mono)\n - [Setting up your environment](#monosetup)\n - [Compiling and running samples](#monocompile)\n - [Developing your own application](#monodevelop)\n - [Running the NUnit tests](#mononunit)\n- [Conclusion](#conclusion)\n\n### Introduction\n\n\u003cbr /\u003e\n\n**Figure 1: The Google Data API solution**\n\nFor many developers, the most difficult part of a new project is getting the ball rolling-installing new software packages, configuring a development environment, and learning new libraries. In this article, I have pulled together some step-by-step instructions for how to begin with the .NET client library using either Visual Studio 2005 for Windows or Mono for Linux and other Unix operating systems. It is my hope that this will save you some time in getting started and let you quickly start working with some code.\n\nVisual Studio 2008\n------------------\n\nIf you do not already have Visual Studio 2008 installed, you may want to consider using [Visual C# 2008 Express Edition](http://msdn.microsoft.com/en-us/library/orm-9780596521066-01-02.aspx), a free version of Visual Studio that will allow you to work with the .NET client library.\n\n### Setting up your environment\n\n1. Download the latest MSI release of the client library from [http://code.google.com/p/google-gdata/downloads/list](//code.google.com/p/google-gdata/downloads/list).\n2. Run the downloaded MSI file to install the package. It will install to \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\\" by default. Further examples in this article will assume you installed the client library to this location.\n3. Open the solution file called \"Google Data API SDK\" in the \"Google Data API SDK\" folder in the Start Menu.\n\n### Compiling and running samples\n\n1. Verify that running \"Build \\\u003e Build Solution\" completes without any errors.\n2. To create a Debug build go to \"Build \\\u003e Configuration Manager\" and select \"Debug\" as the active solution configuration. Then select \"Build \\\u003e Build Solution\".\n3. The binaries and DLL files you have just compiled can be found in \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Sources\\\\Samples\\\\\" For example, you can run the sample application for Calendar by executing \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Sources\\\\Samples\\\\calendar\\\\bin\\\\Debug\\\\Calendar.exe\". There are also some Start Menu shortcuts to these samples.\n\n### Developing your own application\n\nIf you want to develop in a project outside of the solution file provided by the MSI file, you need to add the client library DLL files as a reference path.\n\n1. Create or open a project outside of the Google API SDK solution.\n2. Select \"Add Reference\" from the Project menu.\n3. Click on the Browse tab.\n4. Navigate to the Redist directory in the SDK: \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Redist\".\n5. Select the DLL files that will be used by your code. Google.GData.Extensions.dll and Google.GData.Client.dll will be needed for most projects, along with the DLL file specific to the Google service(s) you are using in your application.\n\n**Note:** There is also a solution file for client libraries on Mobile devices. It is found in \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Sources\\\\Library\\\\VS2005.mobile\" by default. This solution will only compile the DLL files for the client libraries.\n\n### Running the NUnit tests\n\nMaking sure the appropriate NUnit tests pass is an important step if you make any changes to the client libraries or plan to contribute to them. If you plan to use the client libraries without modifications then there is normally no need to run them.\n\n1. Download the .NET 2.0 MSI file release of NUnit from \u003chttp://www.nunit.org/index.php?p=download\u003e.\n2. Install NUnit by running the MSI file. The default install location is similar to \"C:\\\\Program Files\\\\NUnit 2.4.8\". You may wish to change this to something like \"C:\\\\Program Files\\\\NUnit\" so you can upgrade NUnit in the future without having to change the path in your Visual Studio project.\n3. Go to the \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Sources\\\\Library\\\\VS2005\" directory and open the solution file named \"Google Data APIs\". You will see the Conversion Wizard since this is a Visual Studio 2005 project file. Either click through the prompts or simply click on the \"Finish\" button. It should display the conversion log, which can be ignored.\n4. Now NUnit must be added as a reference path. Right click on the \"unittests\" project in the Solution Explorer on the right and select \"Properties\". Now click on the \"Reference Paths\" tab within the window that opens. Enter in the location of the \"bin\" subdirectory of the NUnit installation as a reference path and click \"Add Folder\". For example, if NUnit is installed to \"C:\\\\Program Files\\\\NUnit\\\\\", one would enter \"C:\\\\Program Files\\\\NUnit\\\\bin\". Be sure to save this change before continuing.\n5. Follow the steps listed in [Compiling and running samples](#vscompile) to rebuild the client library and the unit tests.\n6. Copy the \"unittests.dll.config\" file in \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Sources\\\\Library\\\\unittests\\\\\" to your debug build directory \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Source\\\\Library\\\\VS2005\\\\unittests\\\\bin\\\\Debug\\\\\". Remember to edit the file to include the appropriate information for the tests you are running. For example, Base requires an API key and Calendar requires a username and password. It is recommended to use a test account without any live data to avoid having information deleted by the unit tests.\n7. Open NUnit from the Start Menu.\n8. Go to \"File \\\u003e Open Project\" and select the \"unittests.dll\" file from \"C:\\\\Program Files\\\\Google\\\\Google Data API SDK\\\\Source\\\\Library\\\\VS2005\\\\unittests\\\\bin\\\\Debug\\\\\".\n9. Run the unit tests you are interested in. Remember that certain tests require parameters be set in unittests.dll.config to work. If you run the stress tests for certain services you may have your test account flagged as generating spam and be unable to programmatically submit content to Google servers without encountering CAPTCHA challenges.\n\nMono\n----\n\nMono is an open source project that allows you to run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. We offer a separate ZIP file of our client library for developers who want to work on one of these platforms.\n\n### Setting up your environment\n\n1. Download the latest ZIP file release of the client library from [http://code.google.com/p/google-gdata/downloads/list](//code.google.com/p/google-gdata/downloads/list)\n2. Extract to a local directory (e.g. \"/scratch/gdata.NET\")\n3. Use your distribution's package management to install Mono. Alternatively, you can download it from \u003chttp://www.mono-project.com\u003e.\n4. In some distributions you have to make sure that the nunit.framework.dll file is properly linked into the mono library. If mono was installed to \"/usr/lib/mono\", then ensure that there are symbolic links in \"/usr/lib/mono/1.0\" and \"/usr/lib/mono/2.0\" for nunit.framework.dll (which should be installed in \"/usr/lib/mono/gac/nunit.framework/\\\u003csomeversionstring\\\u003e/nunit.framework.dll\").\n\n### Compiling and running samples\n\n1. Assuming you installed the client library to \"/scratch/gdata.NET\", change to the \"/scratch/gdata.NET/clients/cs\" directory.\n2. Edit the Makefile depending on what version of .NET you wish to use. For .NET 1.x, use `CSC=mcs` and for .NET 2.x, use `CSC=gmcs`.\n3. Run `make` to compile the libraries and sample applications.\n4. Execute `make install` if you want to install the client library DLLs into the Mono library.\n\n### Developing your own application\n\nIf you executed a `make install` after compiling the client library, you should be able to include the libraries in your own code by passing `-r:Google.GData.Extensions.dll -r:Google.GData.Client.dll` to the Mono C# compiler along with references to the DLL files of any specific service extensions you wish to use.\n\n### Running the NUnit tests\n\n1. Copy the unittests.dll.config file from \"/scratch/gdata.NET/clients/cs/src/unittests\" to \"/scratch/gdata.NET/clients/cs/\".\n2. Edit \"/scratch/gdata.NET/clients/cs/unittests.dll.config\" to include the appropriate information for the tests you are running. For example, Base requires an API key and Calendar requires a username and password. I recommend using a test account without any live data to avoid having information deleted by the unit tests.\n3. After compiling the library there will be a unittests.dll file in \"/scratch/gdata.NET/clients/cs\". Use this DLL with your NUnit test manager of choice (nunit-console, gnunit, etc.).\n\n### Conclusion\n\nNow you should be able to compile the libraries and run the sample code. This is only the beginning, however. I encourage you to read through the documentation found in the \".../clients/cs/docs\" directory of the client library.\nYou might also want to check out the [.NET Client Library Developer's Guide](/gdata/client-cs), the [project page](http://code.google.com/p/google-gdata/) and [reference guide](http://google-gdata.googlecode.com/svn/docs/Index.html), and the [Google Data .NET client library forum](http://groups.google.com/group/gdata-dotnet-client-library).\n\nTools referenced in this article:\n\n- [Mono Project](http://www.mono-project.com/Main_Page)\n- [Visual Studio](http://msdn2.microsoft.com/en-us/vstudio/default.aspx)\n- [Visual C# 2008 Express Edition](http://msdn.microsoft.com/en-us/library/orm-9780596521066-01-02.aspx)\n- [NUnit](http://www.nunit.org/)\n\nGood luck on your next .NET application!"]]