本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

C# ドキュメント
C#
Getting Started with CSyntax BasicsTypes and DataProjects and PackagesErrors and TestingKey Concepts: LINQ, Delegates, and Async
ディスカッション

C# ガイド · 4/6

Projects and Packages

この章は現在、英語でのみ提供しています。

As a codebase grows, you split it into several projects and start pulling in libraries written by others. .NET organizes this around four units: assemblies, projects, solutions, and NuGet packages. This chapter explains how they fit together, then shows how to reference projects, add packages, and produce output you can ship.

Assemblies, Projects, and Solutions

UnitWhat it is
AssemblyThe compiled output: a .dll library or an executable, containing code plus type metadata.
ProjectOne .csproj file that produces one assembly; it lists sources, target framework, and dependencies.
SolutionA list of projects you build and test together, stored as .sln or the newer XML-based .slnx.
NuGet packageA .nupkg archive of assemblies and metadata, downloaded from a feed such as nuget.org.

Keep namespaces and assemblies apart in your head. A namespace is a logical naming scope; an assembly is a physical unit of deployment. One assembly can contain many namespaces, and a single namespace can span several assemblies.

Creating a Multi-Project Solution

A common layout is an executable, a class library holding the core logic, and a test project, all in one solution. These commands create the skeleton:

mkdir Shop && cd Shop
dotnet new sln -n Shop
dotnet new classlib -o src/Shop.Core
dotnet new console -o src/Shop.Cli
dotnet sln add src/Shop.Core src/Shop.Cli

# let Shop.Cli use the code in Shop.Core
dotnet add src/Shop.Cli reference src/Shop.Core

dotnet build   # from the solution folder, this builds every project

Adding the reference writes an entry like this into Shop.Cli.csproj. At build time the referenced project is compiled first and its assembly is copied into the consumer's output folder.

<ItemGroup>
  <ProjectReference Include="..\Shop.Core\Shop.Core.csproj" />
</ItemGroup>

Access Modifiers Across Assemblies

Only types and members marked public are visible to other projects. internal means visible within the same assembly only, which is how libraries hide implementation details. A top-level type with no modifier defaults to internal.

// src/Shop.Core/PriceCalculator.cs
namespace Shop.Core;

public static class PriceCalculator
{
    public static decimal WithTax(decimal price) => Round(price * (1 + TaxRate));

    internal const decimal TaxRate = 0.1m;   // visible only inside Shop.Core

    private static decimal Round(decimal value) => Math.Round(value, 2);
}
この章について質問がありますか?
前の章Types and Data次の章Errors and Testing
// src/Shop.Cli/Program.cs
using Shop.Core;

Console.WriteLine($"{PriceCalculator.WithTax(100m):F2}"); // 110.00
// PriceCalculator.TaxRate is internal, so it is not accessible here

If a test project needs to exercise internal members, the library can grant access to that specific assembly with the InternalsVisibleTo attribute.

Using NuGet Packages

NuGet is the package manager for .NET. dotnet add package records a PackageReference in the project file, and packages are restored automatically on the next build.

cd src/Shop.Cli
dotnet add package Humanizer                     # add the latest stable version
dotnet add package Humanizer --version <version> # pin a specific version
dotnet list package                              # show referenced packages
dotnet list package --outdated                   # show packages with newer versions
dotnet remove package Humanizer                  # remove it again
dotnet restore                                   # run the restore step on its own
using Humanizer;

Console.WriteLine("order_created_at".Humanize());        // Order created at
Console.WriteLine(TimeSpan.FromMinutes(95).Humanize(2)); // 1 hour, 35 minutes

Before adopting a package, check its download count, how recently it was updated, its license, and which frameworks it supports. When many projects must agree on package versions, central package management lets you set them once in a Directory.Packages.props file at the solution root, and shared build settings can live in Directory.Build.props.

Publishing

dotnet build output is meant for development. To produce something you can deploy to another machine, use dotnet publish:

# framework-dependent: smaller, but the target machine needs the .NET runtime
dotnet publish src/Shop.Cli -c Release -o out

# self-contained: bundles the runtime, nothing to install on the target
dotnet publish src/Shop.Cli -c Release -r linux-x64 --self-contained -o out-linux

# bundle everything into a single executable file
dotnet publish src/Shop.Cli -c Release -r win-x64 --self-contained -p:PublishSingleFile=true

The -r option takes a runtime identifier (RID) such as win-x64, linux-x64, or osx-arm64. If startup time and memory footprint matter, add <PublishAot>true</PublishAot> to the project to compile ahead of time to native code, though libraries that lean heavily on reflection may not be compatible. To share a library as a NuGet package of your own, run dotnet pack -c Release.

Summary

  • Each project produces one assembly, and a solution groups related projects.
  • Add projects to a solution with dotnet sln add and connect them with dotnet add reference.
  • Mark what other assemblies may use as public; keep implementation details internal.
  • dotnet add package records a PackageReference, and packages are restored at build time.
  • Ship with dotnet publish, choosing framework-dependent, self-contained, single-file, or native AOT output.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。