NuGet でゲット! Visual Studio パッケージ マネージャ―概要

Preview:

DESCRIPTION

社内勉強会向けで用意した NuGet 概要のスライドです。

Citation preview

NuGet でゲット! Visual Studio パッケージ マネージャ―概要

日本マイクロソフト株式会社 デベロッパー & プラットフォーム統括本部 エバンジェリスト

井上 章 (いのうえ あきら)

blogs.msdn.com/chack : twitter.com/chack411

Session Takeaways

NuGet の概要を知る

NuGet パッケージの利用

NuGet パッケージの作成と公開

NuGet の応用

NuGet 概要

NuGet でゲット!

NuGet (ぬげっと / にゅーげっと) とは ...

ヘルパーやオープンソース ライブラリのパッケージ公開と 管理の仕組み

Visual Studio や WebMatrix のパッケージ マネージャ機能

GUI / コンソール の 2 通りの利用方法

NuGet ギャラリーを利用したヘルパーの公開

http://nuget.org/

http://nuget.codeplex.com/

Document

Source Code

Tools

...

http://nuget.org/

Package List

Upload

Document

Video

...

http://stats.nuget.org/

NuGet 統計

VS 拡張機能

拡張機能 マネージャー

Visual Studio ギャラリー

ダゕログ vs. コンソール

メニュー [ツール] – [Library Package Manager]

ダゕログ コンソール

パッケージ依存関係の確認

設定

パッケージ キャッシュの管理

アップデート チェックの設定

パッケージ ソース

(フィード URL) の設定

・・・

パッケージの作成

Razor で、かんたん記述!

App_Code フォルダ にファイルを作成 ファイル名: <ヘルパー名>.cshtml (または .vbhtml )

@helper でヘルパーを定義 (@functions で内部関数の定義も可能)

@helper Memo(string content) { <div class="memo"> <p><strong>メモ:</strong>@content</p>

</div> }

<html> @MyHelper.Memo("ヘルパーを作りました!")

</html>

MyHelper.cshtml

使用例

NuGet ギャラリーへの登録と公開

カスタム パッケージの登録方法

1. NuGet ギャラリー サイトでユーザー登録

2. NuGet Package Explorer または NuGet.exe をダウンロード

CodePlex - NuGet プロジェクト : http://nuget.codeplex.com/releases

3. 作成したヘルパーに必要なファイル群をパッケージング (.nupkg)

4. NuGet ギャラリーの My Account ページから Access Key を入手

5. 上記ツールで Access Key を使って NuGet ギャラリーへ発行

NuGet の応用

Microsoft Web Platform: WebMatrix おすすめ学習コンテンツ http://www.microsoft.com/japan/web/webmatrix/learn/

MSDN ASP.NET デベロッパー センター http://msdn.microsoft.com/ja-jp/asp.net/default.aspx

toAllWebCreative - Web の構築に関わるすべての人々へ http://www.microsoft.com/japan/web/

ASP.NET: The Official Microsoft ASP.NET Site (英語) http://www.asp.net/

ScottGu's Blog (英語) http://weblogs.asp.net/scottgu/default.aspx

THE TRUTH IS OUT THERE ~ 井上 章のブログ ~ http://blogs.msdn.com/chack/

ご清聴、誠ににありがとうございました!

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the

part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Recommended