Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneTASTEWINMGestione fileStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailInvestimentiTASTESTOCKApp desktop di trading automatico azionarioIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuroTASTEWINMUn file manager a due pannelli pensato per la tastiera

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Investimenti

TASTESTOCKTrading automatico azionario secondo le regole che decidi tu: quando e che cosa

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeChi siamoInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
Ieri
Visualizzazioni totali
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di C#
C#
Getting Started with CSyntax BasicsTypes and DataProjects and PackagesErrors and TestingKey Concepts: LINQ, Delegates, and Async
Discussioni

Guida a C# · 4/6

Projects and Packages

Per ora questo capitolo è disponibile solo in inglese.

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);
}
Domande su questo capitolo?
Capitolo precedenteTypes and DataCapitolo successivoErrors 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 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.